codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 222 forks source link

Dynamic import does not work on windows after 2.0.7 (re-open part deux) #362

Closed johnnyreilly closed 5 years ago

johnnyreilly commented 6 years ago

First of all, thanks for all the work you do on karma-webpack. It's tremendous; I really appreciate it.

Expected Behavior

This is a reopen of issue #317 which was itself a reopen of #291

The PR https://github.com/webpack-contrib/karma-webpack/pull/338 has not resolved the issue it seems.

Essentially, dynamic imports failing on Windows post v2.0.6.

Actual Behavior

I'm opening this issue as I've tested 4.0.0-rc.2 on Windows; and alas the problem with dynamic imports is still present. It's what we use in ts-loader for our execution test pack.

It's nicely illustrated in this PR which upgrades karma from 2-3 (which caused no issues) and then karma-webpack from 2.0.6 to 4.0.0-rc2:

https://github.com/TypeStrong/ts-loader/pull/840

As you can see, Linux is fine; Windows is not. The failing tests all relate to code splitting / dynamic imports.

How Do We Reproduce?

The simplest way to reproduce this locally is to:

git clone https://github.com/johnnyreilly/ts-loader.git
cd ts-loader
yarn
yarn build
yarn execution-tests --single-test 2.4.1_importCodeSplitting

If you'd like to debug this then do this:

yarn execution-tests --single-test 2.4.1_importCodeSplitting --watch

And go to http://localhost:9876/

This should run a single test which reliably fails on Windows and passes on Mac / Linux.

To understand the context take a look at the test code here: https://github.com/johnnyreilly/ts-loader/tree/master/test/execution-tests/2.4.1_importCodeSplitting

It should (I hope!) be fairly self-explanatory.

gfdickinson commented 6 years ago

Curious, if anyone has taken a look at this?

gfdickinson commented 6 years ago

366 Is this PR relevant to this issue?

johnnyreilly commented 6 years ago

Seems like it could be!