Solvedangular cli iOS 9.3 simulator throws "ReferenceError: Can't find variable: SockJS" error for "ng serve -o"

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI: 1.5.0
Node: 8.5.0
OS: darwin x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cli: 1.5.0
@angular/tsc-wrapped: error
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.1
typescript: 2.4.2
webpack: 3.8.1

Repro steps.

  • ng serve -o
  • Fire up a simulator device with iOS 9.3
  • Access your app at localhost:xxxx

The log given by the failure.

ReferenceError: Can't find variable: SockJS

Desired functionality.

Local webserver should work in iOS 9.3

16 Answers

✔️Accepted Answer

I've found that disabling sourcemaps is a workaround:

$ ng serve --aot --no-sourcemap

Other Answers:

same for Safari 10.1.2

same here for safari 10.1.1

Same on Safari 10.1

Should this not be fixed soon? It is preventing us from updating cli, because we want our projects to work on Safari...

More Issues: