question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't complie ES6 Modules.

See original GitHub issue

Command Line:

java -jar compiler.jar --js_output_file ./../app.cls.js --js **.js  --js_module_root './' --process_common_js_modules --transform_amd_modules --language_
in ECMASCRIPT6

./app.js

import TestClass from './components/TestClass';
export default class Application {
    /**
     * dfdf
     * @var
     */
    constructor() {
        new TestClass();
    }
    /**
     * dfdf
     * @var
     */
    test() {
        alert('dfdf');
    }
}

'./components/TestClass.js'

export default class TestClass  {
    /**
     * dfdf
     * @var
     */
    constructor() {
        alert('test');
    }
    /**
     * dfdf
     * @var
     */
    test() {
    }
}
WARNING - Failed to load module "components/TestClass.js"

app.js:2: ERROR - required "module$components$TestClass" namespace never provided
import TestClass from 'components/TestClass';
^

1 error(s), 1 warning(s)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ChadKillingsworthcommented, Nov 10, 2016

I plan on adding a better error message for this case. It comes up often.

1reaction
dev-mrajcommented, Nov 10, 2016

fixed is using */.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use TypeScript modules that import ES6 ... - GitHub
I am trying to use some ES6 code from a module source folder in node_modules , however that code never gets transpiled to...
Read more >
r.js won't compile ES6 - Stack Overflow
I tried webpack, but it seems i can't get it work. I need the same output as r.js with unnamed defines to concatenated...
Read more >
Avoid these issues when using new ECMAScript modules in ...
Importing commonjs modules into ECMAScript es6 modules. Now that you're targeting es6 or higher you can't require() any commonjs modules in your ...
Read more >
Node Modules at War: Why CommonJS and ES ... - Code Red
ESM can't import named CJS exports unless CJS scripts execute out of order ... That's because CJS scripts compute their named exports as...
Read more >
How to transpile ES modules with webpack and Node.js
As we have mentioned earlier, transpilers either perform the job of compiling one language to another, or to make a language backward compatible ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found