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
const keyword breaking PhantomJS #2407
Comments
It's not webpack that emits a |
Ah... I think you're right... the ts.config was targeting ES6! Thanks! |
add |
I had this issue. It was terrible. The problem for me was that a loader test regex was too permissive and basically the expose loader was running for files that shouldn't, which was injecting code with const. I was not seeing this issue when running karma with Chrome, because Chrome supports const. But when you run it in Phantomjs, 'const' isn't supported. Once I locked down the regex to match the exact file, the problem went away |
@pritishchandak did you need to install ts-helpers? |
I had a rule: { test: /jquery/ } This matched any file with jquery in it. Turns out we had a file with jquery in the path: So I updated the test to match: I did the same with bootstrap.js. |
Webpack appears to be outputting the const keyword instead of the var keyword which is breaking PhantomJS (as it doesn't support ES6 syntax).
So PhantomJS reports
The file in question (karma-shim.js) is being processed by the karma-webpack preprocessor
karma-shim.js
karma.conf.js
webpack.config.js Is part of generator-ng2-webpack (https://github.com/cmelion/generator-ng2-webpack) but doesn't appear to mention transpilation.
The text was updated successfully, but these errors were encountered: