Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic import does not work on windows after 2.0.7 (re-open) #317

Closed
jackysee opened this issue Mar 15, 2018 · 7 comments
Closed

Dynamic import does not work on windows after 2.0.7 (re-open) #317

jackysee opened this issue Mar 15, 2018 · 7 comments

Comments

@jackysee
Copy link

This is an re-open issue of #291. I upgraded the karma and karma webpack, but the dynamic import still not work.

Webpack version:
3.10.0

Webpack Karma version:
2.0.13

Karma version:
2.0.0

Please tell us about your environment:
Windows 10

Browser: Chrome

Current behavior:
Having the webpack do the code splitting at dynamic import statement e.g. import('./file.js'), karma serve the path as system file path and chrome report that it cannot load the resource:

Not allowed to load local resource: file:///C:/Users/jackysee/AppData/Local/Temp/_karma_webpack_/0.bundle.js

Expected/desired behavior:
It should load the resource at e.g. http://localhost:9867/_karma_webpack/0.bundle.js, just as it did in version karma-webpack 2.0.6.

  • demo

https://github.com/jackysee/karam-webpack-test2

@philipahlberg
Copy link

philipahlberg commented Mar 15, 2018

#316 might be a duplicate (webpack 3 vs webpack 4)

@liqueurdetoile
Copy link

I confirm there's still an issue with any version > 2.0.6 of karma-webpack on Windows to load dynamic imports due to this commit : 0616dda

On Windows, os.tmpdir() returns an absolute file path that is not allowed to be loaded through ajax.

@ggriffithsIDBS
Copy link

Any information on this? Us poor Windows users

@Klathmon
Copy link

Yeah i'm still getting the same issue, and I can confirm that going back to 2.0.6 solves the problem temporarily.

@pierluca
Copy link

I have the same issue. Same environment as above (Windows 10, Karma-webpack 3+) and I can confirm it works with 2.0.6 (thanks for the workaround by the way)

@michael-ciniawsky
Copy link
Contributor

#338

@johnnyreilly
Copy link

I've just tested 4.0.0-rc.2 on Windows; still a problem I'm afraid. It's what we use in ts-loader for our execution test pack.

You can see this PR upgrades from 2.0.6 to 4.0.0-rc2 and then experiences issues:

TypeStrong/ts-loader#840

Linux is fine; Windows is not. The failing tests all relate to code splitting / dynamic imports.

I'll open a new issue to track this and link back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants