WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
178216
ES6 Modules: Syntax, binding errors don't provide source file or line number
https://bugs.webkit.org/show_bug.cgi?id=178216
Summary
ES6 Modules: Syntax, binding errors don't provide source file or line number
Richard Connamacher
Reported
2017-10-12 10:09:59 PDT
When an ES6 module (loaded via an import statement) contains a syntax error or error in resolving an "import" statement, the error message printed to the Console is unhelpful. Specifically, it doesn't say which file or line number had the error, and the stack trace simply lists the native "promiseReactionJob". // main.js: import {foo} from "./foo.js" // foo.js: syntax error! export const foo = "Foo"; // Console message: SyntaxError: Unexpected identifier 'error' promiseReactionJob In a traditional script, the syntax error would also indicate the source file (foo.js) and line number (1). This also happens when an "import" is invalid, such as a missing binding: // main.js: import {bar} from "./foo.js" // foo.js: export const foo = "Foo"; // Console message: SyntaxError: Importing binding name 'bar' is not found. link linkAndEvaluateModule (anonymous function) promiseReactionJob As well as if the URL can't be loaded: // main.js import {foo} from "./missing.js"; // Console message: Failed to load resource: the requested URL was not found on the server <url>/missing.js (Would help if it also said which source file had the failed import statement.)
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2017-10-12 19:13:51 PDT
<
rdar://problem/34969296
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug