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

Fails with SyntaxError after recent NPM dependencies update #1712

Closed
dylanhand opened this issue Apr 29, 2024 · 6 comments
Closed

Fails with SyntaxError after recent NPM dependencies update #1712

dylanhand opened this issue Apr 29, 2024 · 6 comments

Comments

@dylanhand
Copy link

dylanhand commented Apr 29, 2024

As of version 4.1.4 As of commit 9c1e94e (#1703), my CI builders are broken with the following error:

Running clone
Running:  node $HOME/tasks/$TASK_ID/_temp/actions/checkout/dist/index.js
+ node /root/tasks/xxxxx/_temp/actions/checkout/dist/index.js
/root/tasks/xxxxx/_temp/actions/checkout/dist/index.js:7620
static {
^
SyntaxError: Unexpected token '{'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
Process exited with code: 1

Caused by line 7620 in dist/index.js, introduced 5 days ago.

I'm guessing the solution is to upgrade node, but thought I'd mention it in case this is unexpected.

@jww3
Copy link
Contributor

jww3 commented Apr 30, 2024

The changes to index.js were minimal in v4.1.4. They were also fairly minimal over the past several releases, with no changes beyond line 2410.

Since releasing v4.1.4, index.js has changed much more extensively as the result of #1703, but those changes are yet to be released.

Image


How are you referencing actions/checkout in your workflow? Can you please include a YML snippet?

@dylanhand
Copy link
Author

Good catch, I wrongly indicated this was because of v4.1.4, but you're right that it was the following commit that broke things for me (#1703) :)

We're using Taskcluster for CI and currently access actions/checkout by simply cloning the repo and using the main branch. We should probably make it possible to pin to a version/tag, but it's never been a problem before.

My current workaround is to checkout the releases/v4.0.0 branch.

The CI machine that has issues is running node v16, which I'm guessing needs an update to support the latest changes.

@dylanhand dylanhand changed the title v4.1.4 fails with SyntaxError Fails with SyntaxError after recent NPM dependencies update Apr 30, 2024
@jww3
Copy link
Contributor

jww3 commented Apr 30, 2024

In the meantime, referencing the commit by SHA should also work (e.g. yourfork/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b)

@jww3 jww3 closed this as completed Apr 30, 2024
@cory-miller
Copy link
Contributor

The CI machine that has issues is running node v16, which I'm guessing needs an update to support the latest changes.

If your runners are on Node 16, you should stick with the v3 tag until you can update the Node version. Checkout (and most first party GH actions) typically use these major version bumps with changes to the available Node runtime. e.g. https://github.com/actions/checkout/releases/tag/v4.0.0

@dylanhand
Copy link
Author

If your runners are on Node 16, you should stick with the v3 tag until you can update the Node version. Checkout (and most first party GH actions) typically use these major version bumps with changes to the available Node runtime. e.g. https://github.com/actions/checkout/releases/tag/v4.0.0

Good to know, thanks for the info :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@dylanhand @cory-miller @jww3 and others