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

[Node.js 20.6 bug] @babel/core does not work in node v20.6 #15927

Closed
1 task done
liuxingbaoyu opened this issue Sep 5, 2023 · 6 comments · Fixed by #15947
Closed
1 task done

[Node.js 20.6 bug] @babel/core does not work in node v20.6 #15927

liuxingbaoyu opened this issue Sep 5, 2023 · 6 comments · Fixed by #15947
Assignees
Labels
area: upstream outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@liuxingbaoyu
Copy link
Member

liuxingbaoyu commented Sep 5, 2023

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

/

Configuration file name

No response

Configuration

No response

Current and expected behavior

image

Environment

node v20.6

Possible solution

No response

Additional context

https://github.com/babel/babel/actions/runs/6069179792/job/16493426064?pr=15922

@liuxingbaoyu
Copy link
Member Author

nodejs/node#49497

This is an upstream problem, and we may be difficult to solve.🤦‍♂️

@demurgos
Copy link
Member

demurgos commented Sep 5, 2023

Error message in text form to help with search (the screenshot in the original post is not properly indexed, please avoid screenshots).

/home/runner/work/babel/babel/packages/babel-core/lib/index.js:7
Object.defineProperty(exports, "File", {
       ^

TypeError: Cannot redefine property: File
    at Function.defineProperty (<anonymous>)
    at Object.<anonymous> (/home/runner/work/babel/babel/packages/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> (/home/runner/work/babel/babel/packages/babel-core/lib/config/helpers/config-api.js:16:14)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)

Node.js v20.6.0

hahn-kev added a commit to sillsdev/languageforge-lexbox that referenced this issue Sep 6, 2023
deot added a commit to deot/dev that referenced this issue Sep 6, 2023
Error `Object.defineProperty(exports, "File", {`
babel/babel#15927
deot added a commit to deot/dev that referenced this issue Sep 6, 2023
Error `Object.defineProperty(exports, "File", {`
babel/babel#15927
connor-baer added a commit to sumup-oss/circuit-ui that referenced this issue Sep 6, 2023
deot added a commit to deot/style that referenced this issue Sep 6, 2023
Error `Object.defineProperty(exports, "File", {`
babel/babel#15927
deot added a commit to deot/helper that referenced this issue Sep 6, 2023
Error `Object.defineProperty(exports, "File", {`
babel/babel#15927
deot added a commit to deot/http that referenced this issue Sep 6, 2023
BeryJu added a commit to goauthentik/authentik that referenced this issue Sep 6, 2023
there are apparently some breaking issues in 20.6 with babel babel/babel#15927

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
BeryJu added a commit to goauthentik/authentik that referenced this issue Sep 6, 2023
* root: lock node to 20.5

there are apparently some breaking issues in 20.6 with babel babel/babel#15927

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* use same version of setup-node everywhere

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
jerome-benoit added a commit to jerome-benoit/plugins that referenced this issue Sep 6, 2023
At least until babel/babel#15927 is fixed

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
BeryJu added a commit to goauthentik/authentik that referenced this issue Sep 6, 2023
* root: lock node to 20.5

there are apparently some breaking issues in 20.6 with babel babel/babel#15927

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* use same version of setup-node everywhere

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
# Conflicts:
#	.github/workflows/ci-web.yml
#	.github/workflows/ci-website.yml
daviwil added a commit to microsoft/typespec that referenced this issue Sep 6, 2023
It looks like CI is failing due to an issue with Babel.js conflicting
with Node 20.6:

babel/babel#15927
vitejs/vite#14299

For now, let's try pinning Node 20.x to 20.5 until the issue gets fixed
in Babel.

Comparable `typespec-azure` repo PR:
https://github.com/Azure/typespec-azure/pull/3502

Issue https://github.com/Azure/typespec-azure/issues/3504 tracks the
work to un-pin the Node version.
deot added a commit to deot/vc that referenced this issue Sep 6, 2023
Error `Object.defineProperty(exports, "File", {`
babel/babel#15927
jonathan-lee-devel added a commit to jonathan-lee-devel/sparrow that referenced this issue Sep 6, 2023
jonathan-lee-devel added a commit to jonathan-lee-devel/sparrow that referenced this issue Sep 6, 2023
jonathan-lee-devel added a commit to jonathan-lee-devel/sparrow that referenced this issue Sep 6, 2023
@nicolo-ribaudo nicolo-ribaudo pinned this issue Sep 7, 2023
@nicolo-ribaudo nicolo-ribaudo changed the title [Bug]: @babel/core does not work in node v20.6 [Node.js 20.6 bug] @babel/core does not work in node v20.6 Sep 7, 2023
@nicolo-ribaudo nicolo-ribaudo unpinned this issue Sep 11, 2023
@vedas-dixit
Copy link

Facing the same problem:

[plugin:vite:react-babel] Cannot redefine property: File
C:/Users/vedas dixit/Desktop/コード/Opensource/nom/idurar-erp-crm/frontend/src/main.jsx
at Function.defineProperty ()
at Object. (C:\Users\vedas dixit\Desktop\コード\Opensource\nom\idurar-erp-crm\frontend\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. (C:\Users\vedas dixit\Desktop\コード\Opensource\nom\idurar-erp-crm\frontend\node_modules@babel\core\lib\config\helpers\config-api.js:16:14)
at Module._compile (node:internal/modules/cjs/loader:1241:14

@nicolo-ribaudo
Copy link
Member

Update Node.js, they fixed the bug.

akm added a commit to akm/connect_sandboxes that referenced this issue Nov 26, 2023
babel + nodejs 20.6.0 のバグを回避するために、バージョンを更新
babel/babel#15927
@MaxiCattaneoCvetic
Copy link

Hello, I have the same issue. I´m using Node 20.11.0

[vite] Internal server error: Cannot redefine property: File
Plugin: vite:react-babel

@Codex-
Copy link

Codex- commented Jan 22, 2024

@MaxiCattaneoCvetic check your lock file, likely having an old version of babel

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Apr 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: upstream outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants