Skip to content
Anton edited this page Jul 30, 2019 · 3 revisions

There are a few insignificant known issues with Google Closure Compiler.

  1. Cannot do import '.': change to import './'.

    // 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)
    
    
  2. node_modules are not looked up higher than the cwd.

  3. 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)
    
    

Clone this wiki locally