Skip to content

Syntax Error in bundle file on subsequent karma runs #407

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

Open
ryanvall opened this issue Oct 2, 2020 · 0 comments
Open

Syntax Error in bundle file on subsequent karma runs #407

ryanvall opened this issue Oct 2, 2020 · 0 comments

Comments

@ryanvall
Copy link
Contributor

ryanvall commented Oct 2, 2020

Hello! Thanks for an excellent package. Integrating it into our project has been relatively seamless save for the below problem. When running tests in headless chrome using karma's single-run=false option, sometimes our tests fail with the below error, indicating that the syntax in the bundle file is invalid:

HeadlessChrome 73.0.3683 (Linux 0.0.0) ERROR
  Uncaught SyntaxError: Invalid or unexpected token
  at /tmp/karma-typescript-bundle--273-swjNth5Jz1xx-.js:1763:18

The error never occurs on the very first run of tests, only subsequent runs, and doesn't happen consistently. Sometimes they fail on the 2nd run, sometimes the 4th, etc. The file passes the built-in syntax validation with acorn, and on additional manual inspection the JS does appear to be valid. We haven't customized our configuration much other than some coverage related items.

The size of the change doesn't seem to matter either - something as small as negating an existing expectation triggers the issue. Any advice on how to debug this would be appreciated - thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant