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
test.js:1:12: ERROR - [JSC_CANNOT_CONVERT] This code cannot be converted from ES6. import.meta
1| console.log(import.meta.url);
^^^^^^^^^^^
1 error(s), 0 warning(s)
We previously used document.currentScript.src, which Closure accepts fine (and our code knows about how Closure can transform and combine files, and handles it accordingly). However the lack of Closure support for import.meta blocks us switching from classic scripts to modules. It should have the same kind of pass-through support as was added for dynamic import.
The text was updated successfully, but these errors were encountered:
This comment appears to indicate pass-through for
import.meta
is supported, but it still doesn't seem to work in v20210601.Input test.js:
console.log(import.meta.url);
Command line:
java -jar ./closure-compiler.jar --compilation_level SIMPLE --language_in ECMASCRIPT_2020 --language_out ECMASCRIPT_2020 --allow_dynamic_import --js test.js --js_output_file out.js
Output:
We previously used
document.currentScript.src
, which Closure accepts fine (and our code knows about how Closure can transform and combine files, and handles it accordingly). However the lack of Closure support forimport.meta
blocks us switching from classic scripts to modules. It should have the same kind of pass-through support as was added for dynamic import.The text was updated successfully, but these errors were encountered: