closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

new dynamic import(path, {}) with options fail with [JSC_PARSE_ERROR] Parse error

Open Nashorn opened this issue 1 year ago • 0 comments

Closure compiler fails when it encounters any code that uses the new dynamic import() with options. Example code snippet that will break CC:

var _module = await import(cssPath, { with: { type: "css" } });

This throws a CC error: ERROR - [JSC_PARSE_ERROR] Parse error. ')' expected 839| var _module = await import(cssPath, {

I understand the work around, but want to know when this will be supported OR is there any flags i can pass to bypass CC having to read/parse my code?

Using version: closure-compiler-v20240317.jar with

ECMASCRIPT_2020 input/output and WHITESPACE_ONLY

Nashorn avatar Aug 20 '24 19:08 Nashorn