question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

IE11: ng test with differential loading: syntax error when fast-check is used

See original GitHub issue

šŸ› Bug Report

If fast-check is added to a spec in a fresh Angular 9.1.12 project with differential loading turned on, Karma will report a syntax error in IE11. Upon investigation it seems, that a ā€œclassā€ keyword lands in the vendor.js bundle served by angular:

class ArrayArbitrary extends _definition_Arbitrary_js__WEBPACK_IMPORTED_MODULE_2__["Arbitrary"] {
//... it looks like further definitions from fast-check follow this line.

To Reproduce

See example repo: https://github.com/delexi/ng-test-fast-check-ie11

Steps to reproduce:

  • Create an Angular 9 project: npx @angular/cli@9.1.12 new fast-check-ie (or use example repo)
  • Enable differential loading and install fast-check and IE support for karma (or use example repo)
  • Add a simple fast-check test (or use example repo)
  • In project root run ng test --configuration=es5
  • If you are quick to press F12 after IE starts up you can capture the syntax error in IEā€™s Console and navigate from there to the correct location in vendor.js mentioned above. Otherwise karmaā€™s console output should mention the syntax error as well.

Expected behavior

I expect that adding fast-check to my angular tests does not break them in IE11.

Your environment

Packages / Softwares Version(s)
fast-check 2.4.0
node 12.8.2
TypeScript 3.8.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
delexicommented, Oct 28, 2020

Actually, the workaround I was talking about happens to be in the thread I already mentioned. This and the following comment: https://github.com/angular/angular-cli/issues/9339#issuecomment-360213460. I havenā€™t actually tried these though.

1reaction
dubzzzcommented, Oct 12, 2020

No worry, Iā€™ll have a look to your issue more precisely and try to come with a better and more sustainable fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IE 11 Syntax error after doing ng serve Ā· Issue #9508 - GitHub
I get this syntax error in main.js (angular 6) pointing to the class statement. Even though my tsonfig.json compiler option is set to...
Read more >
Angular IE11 not working. Getting SCRIPT1002 Syntax Error
The issue is caused by Angular 8's differential loading process. ... getting syntax issues because you are trying to use features that IE11...
Read more >
How To Fix Your Angular App When It's Not Working in IE11
Sometimes, your application may throw errors in IE11, even when it is working ... Since Angular CLI 8, there is a new feature...
Read more >
46110 (IE11: JS "Syntax error" related to wp-polyfill-formdata)
In Internet Explorer 11, there's a JavaScript "Syntax error" related to wp-polyfill-formdata . The error happens in various pages, e.g. in edit.php andĀ ......
Read more >
Internet Explorer 11 testing - Office Add-ins - Microsoft Learn
Test your Office Add-in on Internet Explorer 11.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found