Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Dynamic import does not work for karma #630

Closed
jackysee opened this issue Dec 18, 2017 · 1 comment
Closed

Dynamic import does not work for karma #630

jackysee opened this issue Dec 18, 2017 · 1 comment

Comments

@jackysee
Copy link

Created a very basic app using @neutrinojs/web and @neutrinojs/karma, there is some code using dyanmic import:

export default callback => {
    return import( './echo.js' )
        .then( t => t.text )
        .then( callback );
};

The code can be run OK on neutrino web but not on neutrino test using karma.
The karma debug shows that the file path is incorrect:

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

So it appears that the code splitting bundle is served on a direct file system path in karma.

demo repo here: https://github.com/jackysee/neutrino_vueapp_test

@jackysee
Copy link
Author

Found that it's the karma-webpack plugin problem, filed here: codymikol/karma-webpack#291

For yarn user, you can use selective resolution in package.json:

{
  "resolutions":{
    "@neutrinojs/karma/karma-webpack": "2.0.6"
  }
}

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

No branches or pull requests

1 participant