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

esm is broken by change in Node.js #821

Open
targos opened this issue Jun 18, 2019 · 15 comments
Open

esm is broken by change in Node.js #821

targos opened this issue Jun 18, 2019 · 15 comments
Labels

Comments

@targos
Copy link

targos commented Jun 18, 2019

Found the breakage with CITGM while preparing Node.js 12.5.0.

From this PR: nodejs/node#21387
Affected code:

const { isFile } = Stats.prototype

The isFile method is no longer directly on Stats.prototype but on StatsBase.prototype instead.
The code should theoretically still work because the prototype chain is setup with Object.setPrototypeOf(Stats.prototype, StatsBase.prototype);. My guess is that it's broken because the setup of safe/fs.js does not handle this correctly.

@jdalton
Copy link
Member

jdalton commented Jun 18, 2019

Ah, thank you @targos for the ping. I'll dig into this. I'll try to release a patch ASAP after finding the root cause. Out of curiosity which project is being checked by CITGM?

@targos
Copy link
Author

targos commented Jun 18, 2019

@jdalton You can see the failing modules here: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1878/nodes=fedora-latest-x64/
citgm.clinic-v4.1.0
citgm.fastify-v2.5.0
citgm.semver-v6.1.1
citgm.split2-v3.1.1

@mcollina
Copy link

It's the https://www.node-tap.org/ test framework that is breaking because of this.

@targos
Copy link
Author

targos commented Jul 2, 2019

Is there a path to fix this? I don't want to hold nodejs/node#21387 out of v12.x for too long.

@jdalton
Copy link
Member

jdalton commented Jul 2, 2019

Hi @targos!

Yes, there's totally a path to fix this. I'll try to tackle it within a day (hold me to hit) and I'll keep you posted.

Update:

I got one set of failing tests to pass. Now wrapping up new failing test262 tests.

Update:

Got other set of failing test262 tests to pass. On to the actual issue now :)

Update:

Patched to potentially resolve issue 4f35a24.

@BridgeAR
Copy link

BridgeAR commented Jul 5, 2019

@jdalton thanks a lot for looking into this!

@mcollina
Copy link

@jdalton any updates on this? Thanks!

@jdalton
Copy link
Member

jdalton commented Jul 16, 2019

I've patched this locally but would like a way to test this. Can you point me to the Node PR that is effected so I can build locally and test and/or suggest a unit test that may cover this scenario.

@mcollina
Copy link

https://github.com/mcollina/split2 tests are failing on master because tap is failing to load files.

@targos
Copy link
Author

targos commented Jul 16, 2019

Another way to test this is just to run this repo's tests with Node.js master (you can install a nightly build for example). They failed the same way tap does last time I tried.

@Trott
Copy link

Trott commented Jul 22, 2019

Polite/gentle ping! (Would be great to get this resolved so we can more easily test breaking changes in Node.js.) Anything I or someone else can do to make things easier and nudge this closer to the finish line?

@BridgeAR
Copy link

BridgeAR commented Aug 6, 2019

@jdalton is there any further update?

Trott pushed a commit to Trott/io.js that referenced this issue Aug 7, 2019
Fix to unblock CITGM. See,
standard-things/esm#821.

PR-URL: nodejs#28957
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
BridgeAR pushed a commit to nodejs/node that referenced this issue Sep 3, 2019
Fix to unblock CITGM. See,
standard-things/esm#821.

PR-URL: #28957
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@gtarsia
Copy link

gtarsia commented Oct 7, 2019

Considering this and the other issues with node 12, should pkgs using esm recommend using node < 12?
EDIT: I guess I misread the issues, disregard this.

@Trott
Copy link

Trott commented Oct 8, 2019

Considering this and the other issues with node 12, should pkgs using esm recommend using node < 12?

This issue has been worked around since Node.js 12.10.0 so unless you can specify what you mean by "the other issues", I'd say the answer is probably "no".

@Trott
Copy link

Trott commented Oct 8, 2019

Considering this and the other issues with node 12, should pkgs using esm recommend using node < 12?

This issue has been worked around since Node.js 12.10.0 so unless you can specify what you mean by "the other issues", I'd say the answer is probably "no".

Refs: nodejs/node#28957
Refs: nodejs/node@6ff803d

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

No branches or pull requests

6 participants