request: Webpack compatibility error
I am using webpack to package our server-side code.When I bumped the request package from 2.65.0 to 2.67.0. I get this error:
./web/dist/server.js:153022
module.exports = function() { throw new Error("define cannot be used indirect"); };
Error: define cannot be used indirect
webpack:///(webpack)/buildin/amd-define.js?:1
module.exports = function() { throw new Error("define cannot be used indirect"); };
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 18 (3 by maintainers)
Commits related to this issue
- Downgraded request because of request/request/issues/1920 — committed to amilajack/thepiratebay by amilajack 8 years ago
- Add module to parse request and downgrade request * Downgraded request because of issue https://github.com/request/request/issues/1920 — committed to paulief/Wikipedia-Search by paulief 8 years ago
- change request version to 2.65 trying to avoid webpack error: `define cannot be used indirect`, following advice from: https://github.com/request/request/issues/1920 — committed to ChefSteps/node-google-spreadsheet by nrobin24 8 years ago
The workaround mentioned by @manumax worked for me without having to downgrade request module to 2.65.0. i.e.
$ npm install --save request@2.65.0fixed for me as well.$ npm install --save request@2.65.0fixed it for me. I’m using request-promise and node 5.3.0 / npm 3.3.12.I don’t know if it could help in any way, but a possible workaround is explained here: webpack/webpack#138 i.e. to add the following to your webpack config:
As stated before I’m quite new to javascript and I don’t know if it has any implications, let me know otherwise.