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

Not working with worker loader #28

Open
teod opened this issue Jun 29, 2017 · 1 comment
Open

Not working with worker loader #28

teod opened this issue Jun 29, 2017 · 1 comment
Labels

Comments

@teod
Copy link

teod commented Jun 29, 2017

Prepack fails when trying to parse worker-loader generated bundle

 65% building modules 1234/1335 modules 101 active ...s/babel-runtime/core-js/array/from.jsnot an object
TypeError
    at ../node_modules/babel-loader/lib/index.js!./path/to/worker/file.js(8569baa88463d70f55c2.worker.js:184:34)
    at call (native)
    at __webpack_require__ (8569baa88463d70f55c2.worker.js:20:12)
    at 8569baa88463d70f55c2.worker.js:63:18
    at 8569baa88463d70f55c2.worker.js:1:10
/Users/teo/Work/smartup-ui/node_modules/prepack/lib/prepack-standalone.js:68
    throw _errors.fatalError;
    ^

Error: A fatal error occurred while prepacking.
    at new FatalError (/Users/teo/Work/smartup-ui/node_modules/prepack/lib/errors.js:48:14)
    at Object.<anonymous> (/Users/teo/Work/smartup-ui/node_modules/prepack/lib/errors.js:55:39)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/teo/Work/smartup-ui/node_modules/prepack/lib/realm.js:21:15)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/teo/Work/smartup-ui/node_modules/prepack/lib/methods/call.js:19:14)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
@gajus gajus added the question label Jun 29, 2017
@luigiplr
Copy link

luigiplr commented Dec 1, 2017

Try using a negative lookahead in the test regex. It should then exclude the files generated by worker-loader.

new PrepackWebpackPlugin({
  test: /^(?!.*\.worker).*\.js$/i
})

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

No branches or pull requests

3 participants