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 14.13 problematic (default?) import combinations #35483

Closed
arlac77 opened this issue Oct 3, 2020 · 5 comments
Closed

Node 14.13 problematic (default?) import combinations #35483

arlac77 opened this issue Oct 3, 2020 · 5 comments
Labels
confirmed-bug Issues with confirmed bugs. esm Issues and PRs related to the ECMAScript Modules implementation.

Comments

@arlac77
Copy link

arlac77 commented Oct 3, 2020

There are some import combinations which do not work together any longer (each import alone works fine)

  • Version:v14.13.0
  • Platform: Darwin mbpMarkus 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
  • Subsystem:

What steps will reproduce the bug?

import recast from "recast";
import lockfile from '@yarnpkg/lockfile';

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

Always (starting with node 14.13)

What is the expected behavior?

two default exports provided

What do you see instead?

node issue.mjs 
node_modules/recast/lib/lines.js:580
    assert_1.default.ok(tabWidth || tabless, "No tab width specified but encountered tabs in string\n" + string);
                     ^

TypeError: assert_1.default.ok is not a function
    at fromString (node_modules/recast/lib/lines.js:580:22)
    at Object.<anonymous> (/node_modules/recast/lib/lines.js:654:18)
    at Module._compile (internal/modules/cjs/loader.js:1085:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:791:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (node_modules/recast/lib/parser.js:11:15)
    at Module._compile (internal/modules/cjs/loader.js:1085:30)

Additional information

Saw the problem with other combinations of imports to

@targos targos added confirmed-bug Issues with confirmed bugs. esm Issues and PRs related to the ECMAScript Modules implementation. labels Oct 4, 2020
@targos
Copy link
Member

targos commented Oct 4, 2020

/cc @nodejs/modules

I verified this can be reproduced in v14.13.0 while it works in v14.12.0.

@targos
Copy link
Member

targos commented Oct 4, 2020

Reverting #35249 fixes it.

@targos
Copy link
Member

targos commented Oct 4, 2020

The TypeError: assert_1.default.ok is not a function error is thrown because in node_modules/recast/lib/lines.js, require('assert') returns an empty object instead of the assert module.

@guybedford
Copy link
Contributor

PR at #35500.

@arlac77
Copy link
Author

arlac77 commented Oct 8, 2020

I can confirm fixed with 14.13.1

@arlac77 arlac77 closed this as completed Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants