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

Closed
jeremymeng opened this issue Dec 6, 2023 · 4 comments
Closed

regression in 21.4.0 when using esm package #51081

jeremymeng opened this issue Dec 6, 2023 · 4 comments
Labels
fs Issues and PRs related to the fs subsystem / file system. wontfix Issues that will not be fixed.

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 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 <[email protected]>
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 <[email protected]>
@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.

@targos targos added v22.x v22.x Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch. and removed v21.x labels Jul 16, 2024
@RedYetiDev RedYetiDev added wontfix Issues that will not be fixed. and removed regression Issues related to regressions. v22.x v22.x Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch. labels Jul 16, 2024
@RedYetiDev RedYetiDev closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2024
@RedYetiDev
Copy link
Member

Given @GeoffreyBooth's response, I've closed this as wontfix. If you disagree, feel free to reopen / leave a comment

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. wontfix Issues that will not be fixed.
Projects
None yet
Development

No branches or pull requests

5 participants