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

Syntax errors are misattributed to ModuleRequest.js:33:13 #21100

Closed
qwertie opened this issue Jun 2, 2018 · 3 comments
Closed

Syntax errors are misattributed to ModuleRequest.js:33:13 #21100

qwertie opened this issue Jun 2, 2018 · 3 comments
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation.

Comments

@qwertie
Copy link

qwertie commented Jun 2, 2018

  • Version: v8.11.1
  • Platform: Win7 64-bit
  • Subsystem: --experimental-modules

If a module refers to another module with a syntax error, e.g.

// script.mjs
import * as module from './module';
// module.mjs
export default function parse(csv, reviver) {
},

export function stringify(table, replacer) {
}

Node claims that the syntax error is within Node.js itself:

>node --experimental-modules "script.mjs"
(node:8428) ExperimentalWarning: The ESM module loader is experimental.
SyntaxError: Unexpected token ,
    at ModuleJob.loaders.set [as moduleProvider] (internal/loader/ModuleRequest.js:33:13)
    at <anonymous>
@devsnek devsnek added the errors Issues and PRs related to JavaScript errors originated in Node.js core. label Jun 2, 2018
@devsnek
Copy link
Member

devsnek commented Jun 2, 2018

related to #19783, #19763, #19815

@Trott
Copy link
Member

Trott commented Jun 3, 2018

Fixed (or improved at least?) in Node.js 10.x. (h/t @targos)

$ node --experimental-modules "script.mjs"
(node:11120) ExperimentalWarning: The ESM module loader is experimental.
file:///Users/trott/io.js/module.mjs:2
},
 ^
SyntaxError: Unexpected token ,
    at translators.set (internal/modules/esm/translators.js:31:13)
$ 

@bnoordhuis
Copy link
Member

Yes, this was fixed in #17281 and/or #17786. I'll close this out.

@bnoordhuis bnoordhuis added esm Issues and PRs related to the ECMAScript Modules implementation. v8.x labels Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

No branches or pull requests

4 participants