Skip to content

eval-source-map results in "Can't find variable: SockJS" in Safari on Mac and iOS with v2.8.x #1090

@purdrew

Description

@purdrew
  • Operating System: macOS 10.12.6
  • Node Version: v7.10.0
  • NPM Version: 4.2.0
  • webpack Version: 2.7.0
  • webpack-dev-server Version: 2.8.2
  • This is a feature request
  • This is a bug

Code

Sample code here

Expected Behavior

Using the eval-source-map option for devtool should not affect the ability to render the page.

Actual Behavior

With version 2.8.x it seems like specifying eval-source-map for devtool is causing an error that is preventing rendering on Safari on Mac and iOS. Rendering seems fine on Chrome/Firefox, but when loading the page in Safari I'm getting:

ReferenceError: Can't find variable: SockJS

I suspect something in the "Cleanup Effort" commit might have broke this but haven't identified what. Maybe something to do with uglifyJS plugin being added

How can we reproduce the behavior?

The gist has a complete code sample that exhibits the issue:

  1. Download the gist code.
  2. npm install
  3. npm start
  4. Load localhost:8000 in Safari and open dev tools console to see error. Notice the page doesn't render either.
  5. Kill the npm start
  6. Open webpack.config.js and remove devtool: 'eval-source-map'.
  7. npm start
  8. Load localhost:8000 in Safari and notice it now renders and the dev tools console is clean.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions