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

Build fails with Node 20.6 #8411

Closed
1 task done
lilnasy opened this issue Sep 5, 2023 · 9 comments
Closed
1 task done

Build fails with Node 20.6 #8411

lilnasy opened this issue Sep 5, 2023 · 9 comments
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) ecosystem: upstream Upstream package has issue

Comments

@lilnasy
Copy link
Contributor

lilnasy commented Sep 5, 2023

Astro Info

Astro                    v3.0.8
Node                     v20.6.0
System                   Linux (x64) // also Windows (x64)
Package Manager          pnpm        // also npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

image

What's the expected result?

Users are able to build their projects.

Link to Minimal Reproducible Example

Any astro project on Node 20.6

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 5, 2023
@lilnasy lilnasy added ecosystem: upstream Upstream package has issue - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) and removed needs triage Issue needs to be triaged labels Sep 5, 2023
@lilnasy
Copy link
Contributor Author

lilnasy commented Sep 5, 2023

babel/babel#15927

Edit: upstream in node, not babel.
nodejs/node#49497

@nathanchere
Copy link

Downgrading to nodejs 20.5 at least works around it until the fix is released.

@unitof
Copy link

unitof commented Sep 6, 2023

Pasting text of errors I get for better searchability—took a while to find this via nodejs/node#49497 (comment)!

When running astro dev or astro build:

/Users/jacob/repos/nc/wv-learningcenter/node_modules/@babel/core/lib/index.js:7
Object.defineProperty(exports, "File", {
       ^

TypeError: Cannot redefine property: File
    at Function.defineProperty (<anonymous>)
    at Object.<anonymous> (/Users/jacob/repos/nc/wv-learningcenter/node_modules/@babel/core/lib/index.js:7:8)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/Users/jacob/repos/nc/wv-learningcenter/node_modules/@babel/core/lib/config/helpers/config-api.js:16:9)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)

Node.js v20.6.0
npm ERR! Lifecycle script `dev` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: wv-learningcenter-web 
npm ERR!   at location: /Users/jacob/repos/nc/wv-learningcenter/apps/web 

When running astro add:

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

TypeError: Cannot redefine property: Hub
    at Function.defineProperty (<anonymous>)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/astro/node_modules/@babel/traverse/lib/index.js:6:8)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/astro/node_modules/@babel/traverse/lib/path/index.js:9:14)
    at Module._compile (node:internal/modules/cjs/loader:1241:14) {
⋮

@lilnasy
Copy link
Contributor Author

lilnasy commented Sep 6, 2023

Yeah figured a message by astro would be nice for this reason. It is hard to get to the bottom of this as a user.

But they fixed it, so hopefully it's a matter of a few hours before 20.6.1 is released.

@nicolo-ribaudo
Copy link

We added a workaround for this in @babel/core, @babel/traverse and @babel/types 7.22.17

@adaptive
Copy link

adaptive commented Sep 8, 2023

20.6.1 fix it and released.

@bluwy
Copy link
Member

bluwy commented Sep 11, 2023

I don't really think there's much we can do at this point. If you're still seeing the issue in 20.6.1, please report it to nodejs. Or you can upgrade the babel dependencies to latest. Closing this as resolved.

@bluwy bluwy closed this as completed Sep 11, 2023
@backflip
Copy link
Contributor

20.6.1 fixes the issue for me.

@nathanchere
Copy link

Switching to bun also fixed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) ecosystem: upstream Upstream package has issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants