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

webpack error: define cannot be used indirect (lazy-array.js) #58

Open
kumar303 opened this issue Feb 8, 2016 · 0 comments
Open

webpack error: define cannot be used indirect (lazy-array.js) #58

kumar303 opened this issue Feb 8, 2016 · 0 comments

Comments

@kumar303
Copy link

kumar303 commented Feb 8, 2016

I get this webpack error when trying to use promised-io via ES6 and babel like:

import fs from 'promised-io/fs';
...
/Users/kumar/dev/web-ext/dist/webpack:/(webpack)/buildin/amd-define.js:1
module.exports = function() { throw new Error("define cannot be used indirect"); };
                             ^
Error: define cannot be used indirect
    at Object.module.exports [as define] (/Users/kumar/dev/web-ext/dist/webpack:/(webpack)/buildin/amd-define.js:1:30)
    at Object.module.exports.module.exports (/Users/kumar/dev/web-ext/dist/webpack:/~/promised-io/lazy-array.js:2:1)
    at __webpack_require__ (/Users/kumar/dev/web-ext/dist/webpack:/webpack/bootstrap 2285ad9b75dd8ebedb0f:19:1)
...

I don't fully understand it but I guess it doesn't like how lazy-array.js is doing exports? If I put this in my webpack config the error goes away.

module: {
  noParse: /node_modules\/promised-io\/lazy-array\.js/,
}

However, I get 'cannot find module' errors after that for somewhat obvious reasons.

  • webpack: 1.12.13
  • node 4.2.3
  • promised-io: 0.3.5
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

1 participant