You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
Activity
targos commentedon Oct 4, 2020
/cc @nodejs/modules
I verified this can be reproduced in v14.13.0 while it works in v14.12.0.
targos commentedon Oct 4, 2020
Reverting #35249 fixes it.
targos commentedon Oct 4, 2020
The
TypeError: assert_1.default.ok is not a functionerror is thrown because innode_modules/recast/lib/lines.js,require('assert')returns an empty object instead of the assert module.guybedford commentedon Oct 4, 2020
PR at #35500.
arlac77 commentedon Oct 8, 2020
I can confirm fixed with 14.13.1