Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript compilation error SyntaxError: Unexpected token '.' (yaml: "^2.0.1") #397

Closed
Moon1706 opened this issue Jun 10, 2022 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@Moon1706
Copy link

Moon1706 commented Jun 10, 2022

Describe the bug
Hi guys! I was contributing to Pulumi GitHub action, when found this bug. I've developed a new feature in the middle of the April and all was okay. But the owner of the repo checked my code only a 2 months later, and we got this error. When I got back from ^2.0.1 to 2.0.1 trouble is disappeared. Could you check this?

To Reproduce
Steps to reproduce the behaviour.

  1. Add yaml ^2.0.1 to package.json
  2. Build with yarn
  3. Profit
    https://github.com/pulumi/actions/tree/982ee41fcc25609042a89cf6043af498a30146e8
    https://github.com/Moon1706/actions/runs/6825643139?check_suite_focus=true

Expected behaviour
A clear and concise description of what you expected to happen.
I expected this behavior.

Versions (please complete the following information):
yaml: 2.1.1
node-version: 14.x

Additional context
Add any other context about the problem here.

@Moon1706 Moon1706 added the bug Something isn't working label Jun 10, 2022
@zifenggao
Copy link

Encountered the same problem

@eemeli
Copy link
Owner

eemeli commented Jun 10, 2022

This is pretty much the same thing as #394, which I've now pinned to hopefully guide others who encounter this. This is not a problem with yaml, but with other tools that need to be updated.

In this particular case, it looks like @pulumi/pulumi is using typescript@3.7.5, which does not support optional chaining (the syntax with which you encountered this error). You should get that updated to at least v3.8, which was released two years ago.

@eemeli eemeli added duplicate This issue or pull request already exists and removed bug Something isn't working labels Jun 10, 2022
@evilaliv3
Copy link

evilaliv3 commented Jul 4, 2022

We are encountering this as well @globaleaks while using npm-check-updates 15.0.2

@raineorshine have you ever encountered this? we are still using npm-check-updates 12.5.12 for this reason and the difference is exactly that on 13.0.0 you stared using yaml:"^2.1.0"; thank you if you could recheck on this an provide advice

@raineorshine
Copy link

@evilaliv3 I haven't encountered any problems with yaml v2.x myself, so I am not sure. It does not appear to be affecting other npm-check-updates users.

@evilaliv3
Copy link

evilaliv3 commented Jul 4, 2022

That was fast, thank you @raineorshine for your feedback!

Actually updating to node 16.15.1 and npm 8.1.0 solved the issue for us.

@eemeli
Copy link
Owner

eemeli commented Aug 3, 2022

Closing this, as there's no action on the yaml side and it looks like the upstream fixes have been merged as well.

@eemeli eemeli closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants