-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need Help to sort out my issue ''Uncaught SyntaxError #411
Comments
set |
@07akioni thanks for the heads up. I'm sorry, i really dont understand what you're trying to say. !! can you pls explain it clearly? Thanks |
It seems your tsconfig module is already common js. I've run into your problem to and solved it by changing module to However I can't figure out what happened to your project. Sorry for that. |
just found couple of below exports from @zxing\library\esm\browser.js is this the problem why am getting Uncaught SyntaxError: Unexpected token 'export' at assets/@zxing/library/esm/browser.js:2 ?
here your see the actual library zxing |
Maybe you can try adding those files' path to
|
@07akioni Sorry for stepping in like that, but does I now have a situation where the lib is built with |
@suriyaJaay The library you're trying to consume is provided in ES6 Module (ESM) format. The To load ESM-format dependencies in your CJS bundle, you need to "downlevel" (transpile) them to a CJS module format. That's what the karma-typescript-es6-transform is for. As part of the |
Hi @thw0rted, if you're still around. I had a quick question. Does The thing is, if I use |
Yeah, unfortunately the ESM-vs-CJS thing has gotten really hairy since I wrote that previous post. I actually just got bitten a month or two ago, I burned a whole day debugging build issues that turned out to be because I have a dep that exports a Node-only build as |
I had to do exactly the same thing. Not sure which bundler With |
I should have mentioned, I gave up on trying to use karma-typescript and went back to karma-webpack. Tests take a pretty long time to re-run after changes, because it has to do a full webpack build every time, but it works pretty consistently (other than the CJS-entry-point issue). I might try karma-typescript again on my next project, starting from the ground up... |
Hi @abraham , @xdamman , @vidartf , @tokrsen, Could someone please help me out for below issue?
I'm trying to solve the issue am facing since last week. Currently, I'm trying to integrate and use https://github.com/zxing-js/library library in my Angular.JS 1.3 application, which is completely working fine.
But facing the Uncaught SyntaxError: Unexpected token 'export' at assets/@zxing/library/esm/browser.js:2 whenever I run gulp karmaRunDebug . Due to this, CI/CD getting failed.
Kindly help me solve this issue.
karma.config.js
tsconfig.json
Could you pls tell me what needs to be modify here?
Thanks you so much for helping me
The text was updated successfully, but these errors were encountered: