-
Notifications
You must be signed in to change notification settings - Fork 0
Bugs
Anton edited this page Jan 28, 2020
·
3 revisions
There are a few insignificant known issues with Google Closure Compiler.
-
Cannot do
import '.'
: change toimport './'
.// dot.js import test from '.' test()
// index.js export default () => { console.log('test') }
Show Dot Error
Exit code 1 example/bugs/dot.js:2: ERROR - [JSC_JS_MODULE_LOAD_WARNING] Failed to load module "." import test from '.' ^ 1 error(s), 0 warning(s)
-
node_modules
are not looked up higher than thecwd
. -
Cannot import json files. Use
require
.import data from './data.json' console.log(data)
Show JSON Error
Exit code 1 example/bugs/json.js:1: ERROR - [JSC_CANNOT_PATH_IMPORT_CLOSURE_FILE] Cannot import Closure files by path. Use either import goog:namespace or goog.require(namespace) import data from './data.json' ^ 1 error(s), 0 warning(s)
-
Destructuring is broken in Jan 2020 but should be fixed in Feb release.
(async () => { const data = await fetch('https://api.com') // should not be renamed const { 'hello': hello } = data console.log(hello) })()
Show destructuring Error
'use strict';(async()=>{const a=(await fetch("https://api.com")).a;console.log(a)})();