-
Notifications
You must be signed in to change notification settings - Fork 10
Unexpected token import: ES2015 module support without transpiling to CommonJS #5
Comments
Hey @CKGrafico! It's a bit too little information to debug. What does your You can also have a look at andywer/key-store. |
Ups sorry, the tsconfig is the default tsconfig of nuxt typescript example https://github.com/nuxt/nuxt.js/blob/dev/examples/typescript/tsconfig.json |
Can't really help here, I fear, since I would need to have access to a project that reproduces the issue. I can only suggest you have a look at |
You can clone this repo http://bit.ly/2BHkpRV is public :) by the moment I've added mocha for the tests but the community of nuxt is using ava and we want to try |
Update: I think you have to set If it's set to |
Ok in this case I can't use ava thanks |
Hi I'm having the same issue Is there any way to override the tsconfig used by |
Hey @mastilver. Yeah, just add a Should probably add a FAQ section to the readme. |
Thank you for the quick answer!! :) I already have |
Hmmm... Maybe conditionally loading https://github.com/standard-things/esm together with Will re-open the issue and change the title. Can you check if monkey-patching api.js to load |
Thank you so much This worked for me:
|
Awesome! Will add a FAQ section later. That should do for the moment :) @CKGrafico That sounds like good news for you, too. |
Sounds like I was too quick to shoot victory :/ I still had I've switch back to normal Thank you for your time anyway :) |
I can't invest time on this for now, but yes if you need ts node probably a config like the project mentioned before will works http://bit.ly/2BHkpRV by the moment I will use mocha because I've all working from other projects but change to ava with this config have to be easy |
@ALL Better late than never... There is an easy solution! You can just set the "scripts": {
- "test": "ava-ts"
+ "test": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ava-ts"
} We should probably have a command line parameter for that, though. |
this definitely needs a CLI parameter IMO. |
I've made a simple test like your example and I've this error:
the test:
The text was updated successfully, but these errors were encountered: