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

regression in 21.4.0 when using esm package #51081

Open
jeremymeng opened this issue Dec 6, 2023 · 3 comments
Open

regression in 21.4.0 when using esm package #51081

jeremymeng opened this issue Dec 6, 2023 · 3 comments
Labels
fs Issues and PRs related to the fs subsystem / file system. regression Issues related to regressions. v21.x v21.x Issues that can be reproduced on v21.x or PRs targeting the v21.x-staging branch.

Comments

@jeremymeng
Copy link

Version

v21.4.0

Platform

Linux codespaces-8a914d 6.2.0-1016-azure #16~22.04.1-Ubuntu SMP Tue Oct 10 17:11:51 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

  1. npm init -y
  2. npm add esm
  3. create a file test.js with the following content
import { writeFileSync } from "fs";
console.log("hello");
  1. node -r esm test.js

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

same as in v21.3.0

/workspaces/working/mocha/esm-test $ nvm use v21.3.0
Now using node v21.3.0 (npm v10.2.4)
/workspaces/working/mocha/esm-test $ node -r esm test.js
hello

What do you see instead?

content of esm.js is dumped to console for a TypeError

TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
    at node:internal/main/run_main_module:28:49

Node.js v21.4.0

Additional information

No response

@targos
Copy link
Member

targos commented Dec 7, 2023

This is from #50907

/cc @ronag @anonrig

@targos targos added fs Issues and PRs related to the fs subsystem / file system. v21.x v21.x Issues that can be reproduced on v21.x or PRs targeting the v21.x-staging branch. labels Dec 7, 2023
jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Dec 14, 2023
because of nodejs/node#51081

Revert "[EngSys] unpin NodeTestVersion of 21.2.0 (Azure#27999)"

This reverts commit 884d750.
jeremymeng added a commit to Azure/azure-sdk-for-js that referenced this issue Dec 14, 2023
Because of a regression in v21.4.0, running our tests with `esm` package
is broken.

nodejs/node#51081

Revert "[EngSys] unpin NodeTestVersion of 21.2.0 (#27999)"

This reverts commit 884d750.
jeremymeng added a commit to jeremymeng/node that referenced this issue Jan 4, 2024
This reverts commit 95b1989.

It appears that the workaround is still needed: issue nodejs#51081
jeremymeng added a commit to jeremymeng/node that referenced this issue Jan 5, 2024
This reverts commit 95b1989.

It appears that the workaround is still needed: issue nodejs#51081
targos pushed a commit to jeremymeng/node that referenced this issue Feb 20, 2024
This reverts commit 95b1989.

It appears that the workaround is still needed: issue nodejs#51081
marco-ippolito pushed a commit to jeremymeng/node that referenced this issue Feb 26, 2024
This reverts commit 95b1989.

It appears that the workaround is still needed: issue nodejs#51081
marco-ippolito pushed a commit to jeremymeng/node that referenced this issue Feb 27, 2024
This reverts commit 95b1989.

It appears that the workaround is still needed: issue nodejs#51081
marco-ippolito pushed a commit that referenced this issue Feb 27, 2024
This reverts commit 95b1989.

It appears that the workaround is still needed: issue #51081

Backport-PR-URL: #51390
PR-URL: #51390
Fixes: #51081
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
marco-ippolito pushed a commit that referenced this issue Feb 29, 2024
This reverts commit 95b1989.

It appears that the workaround is still needed: issue #51081

Backport-PR-URL: #51390
PR-URL: #50907
Fixes: #51081
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
@RedYetiDev RedYetiDev added the regression Issues related to regressions. label Apr 26, 2024
@yoroshikun
Copy link

This is also reproducible in node 22.x.x, 🙇 so revert needs to be applied there I think.

@GeoffreyBooth
Copy link
Member

This isn't really a bug. We changed some undocumented internals that esm relied on, knowing it would break. Anyone can fork esm to update it accordingly; reverting the change would break other things now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. regression Issues related to regressions. v21.x v21.x Issues that can be reproduced on v21.x or PRs targeting the v21.x-staging branch.
Projects
None yet
Development

No branches or pull requests

5 participants