Closed ktsn closed 7 years ago
@ktsn Thank you for reporting and reproduction case! I'll investigate it.
Determining sourceType
(script
or module
) needs a design decision, so is a bit hard problem but I have to tackle with it.
Thanks a lot!
Thank you for reporting. Just released espower-source 2.2.0, and webpack-espower-loader 1.1.0 is coming soon.
@twada Thank you for the fix! I'm looking forward the next release 🙂
@ktsn Sorry for waiting so long. upgrade espower-source to ^2.0.0 has done and webpack-espower-loader 1.1.0 is out. Would you check it out?
@twada I've try the new version of webpack-espower-loader but there is another error 😞
$ webpack && mocha test.build.js Hash: 952ee050f6040cd3f5da Version: webpack 2.4.1 Time: 143ms Asset Size Chunks Chunk Names test.build.js 4.17 kB 0 [emitted] main [0] ./test.js 1.53 kB {0} [built] [failed] [1 error] ERROR in ./test.js Module build failed: AssertionError: ImportDeclaration should appear when the mode is ES6 and in the module context. at Referencer.ImportDeclaration (/Users/katashin/dev/playground/espower-source-test/node_modules/escope/lib/referencer.js:591:34) at Referencer.Visitor.visit (/Users/katashin/dev/playground/espower-source-test/node_modules/esrecurse/esrecurse.js:122:34) at Referencer.Visitor.visitChildren (/Users/katashin/dev/playground/espower-source-test/node_modules/esrecurse/esrecurse.js:101:38) at Referencer.Program (/Users/katashin/dev/playground/espower-source-test/node_modules/escope/lib/referencer.js:419:18) at Referencer.Visitor.visit (/Users/katashin/dev/playground/espower-source-test/node_modules/esrecurse/esrecurse.js:122:34) at Object.analyze (/Users/katashin/dev/playground/espower-source-test/node_modules/escope/lib/index.js:153:16) at Instrumentor.createVisitor (/Users/katashin/dev/playground/espower-source-test/node_modules/espower/lib/instrumentor.js:31:31) at Function.createVisitor (/Users/katashin/dev/playground/espower-source-test/node_modules/espower/index.js:43:25) at instrument (/Users/katashin/dev/playground/espower-source-test/node_modules/espower-source/index.js:186:17) at espowerSource (/Users/katashin/dev/playground/espower-source-test/node_modules/espower-source/index.js:235:24) at Object.module.exports (/Users/katashin/dev/playground/espower-source-test/node_modules/webpack-espower-loader/index.js:27:28) error Command failed with exit code 2.
I've updated the reproduction. https://github.com/ktsn/espower-source-test
@ktsn OMG I should have checked on your repro case... so sorry for that. The problem is now on escope
usage and I'll fix it ASAP.
Take it easy! I can transpile test codes to commonjs for now 🙂
Just released espower 2.1.0 to fix current problem.
@ktsn Would you give it a try? (in other words, rm -rf node_modules && npm install && npm test
again?)
@twada It works perfectly now. Thank you so much for your help!
@ktsn glad to hear that :)
Hello.
I faced an issue when using power-assert with webpack2 (using webpack-espower-loader). When I compile test code that includes ES Module syntax, it always throws error.
As the error message says, I suspect the option of acorn in espower-source is the root cause but I'm not so much sure about it. Could you take a look into it?
Error log
The reproduction project is here. Below is the step to reproduce it.
$ npm install
$ npm test
Thanks.