codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 222 forks source link

Fails to load workers on Windows for versions ^2.0.8 (and 3.0.0) #333

Closed jsleuth closed 6 years ago

jsleuth commented 6 years ago

I'm submitting a bug report

Webpack version: 3.11.0

Webpack Karma version: ^2.0.8 (issue does not happen on 2.0.6)

Karma version: 2.0.2

Please tell us about your environment: Windows 7

Browser: Chrome 69.0.3452.0 (Developer Build) (64-bit)

Current behavior: karma-webpack is failing to load worker files. It appears that karma-webpack attempts to load workers from the filesystem instead of http://localhost:port/ and fails because the file is not found.

Failed: Failed to construct 'Worker': Script at 'file:///C:/Users/JSLEUTH/AppData/Local/Temp/_karma_webpack_a74482acdfd8c8d3635c.worker.js' cannot be accessed from origin 'http://localhost:11337'.
SecurityError: Failed to construct 'Worker': Script at 'file:///C:/Users/JSLEUTH/AppData/Local/Temp/_karma_webpack_a74482acdfd8c8d3635c.worker.js' cannot be accessed from origin 'http://localhost:11337'.
    at new 806.module.exports (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:121701:1007)
    at WorkerDriver.initWorker (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:118319:50450)
    at new WorkerDriver (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:118319:39805)
    at Bucket.<anonymous> (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:42870:60566)
    at step (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:263:23)
    at Object.next (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:244:53)
    at http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:237:71
    at Object.__awaiter [as b] (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:233:12)
    at Bucket.initDriver (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:42870:59788)
    at Bucket.<anonymous> (http://localhost:11337/base/karma.setup.js?8f670c6ddbb5beddcdb5ff8de9075302b08f7e8c:42870:50275)

Expected/desired behavior: Load the worker and be able to use it (possibly by loading from http://localhost:port/ as is done for all other bundles).

michael-ciniawsky commented 6 years ago

Released in 4.0.0-rc.2 🎉