postcss-import: Moving from 8.0.2 to 8.1.2 causes many "Cannot resolve module" errors with Webpack.
I’m using:
- webpack 1.13.1
- postcss 5.0.21
- postcss-cssnext 2.5.2
When I bump from postcss-import 8.0.2 to 8.1.2 then I get the following errors:
ERROR in ./~/request/lib/har.js
Module not found: Error: Cannot resolve module 'fs' in /project_path/node_modules/request/lib
@ ./~/request/lib/har.js 3:9-22
ERROR in ./~/forever-agent/index.js
Module not found: Error: Cannot resolve module 'net' in /project_path/node_modules/forever-agent
@ ./~/forever-agent/index.js 6:10-24
ERROR in ./~/forever-agent/index.js
Module not found: Error: Cannot resolve module 'tls' in /project_path/node_modules/forever-agent
@ ./~/forever-agent/index.js 7:10-24
ERROR in ./~/tough-cookie/lib/cookie.js
Module not found: Error: Cannot resolve module 'net' in /project_path/node_modules/tough-cookie/lib
@ ./~/tough-cookie/lib/cookie.js 32:10-24
ERROR in ./~/form-data/lib/form_data.js
Module not found: Error: Cannot resolve module 'fs' in /project_path/node_modules/form-data/lib
@ ./~/form-data/lib/form_data.js 7:9-22
ERROR in ./~/tunnel-agent/index.js
Module not found: Error: Cannot resolve module 'net' in /project_path/node_modules/tunnel-agent
@ ./~/tunnel-agent/index.js 3:10-24
ERROR in ./~/tunnel-agent/index.js
Module not found: Error: Cannot resolve module 'tls' in /project_path/node_modules/tunnel-agent
@ ./~/tunnel-agent/index.js 4:10-24
I tried adding the following to my webpack config but it doesn’t work:
node: {
net: 'empty',
tls: 'empty',
fs: 'empty'
},
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (2 by maintainers)
Commits related to this issue
- Downgrade `postcss-import` version Newer releases cause issues with Webpack https://github.com/postcss/postcss-import/issues/220 — committed to nevenagaj/praline by langri-sha 8 years ago
- Postcss-import updated to 8.1.0, latest version it can accept; see: https://github.com/postcss/postcss-import/issues/220 — committed to ebrake/visav-health-platform by deleted user 8 years ago
Same here
@code4aman try running
npm prune
to remove thepkg-resolve
dependency.postcss-loader@9
will still try to load it if it is available.Just pointing out that the reason of this breaking is explained at https://github.com/webpack/webpack/issues/2411#issuecomment-247132992
Good to hear, closing. Will try to get v9 shipped as soon as I can.
A PR (hopefully) fixing this has been merged to the
v9-dev
branch (https://github.com/postcss/postcss-import/pull/243). Can someone install thev9-dev
branch in their project and confirm that this issue is fixed on that branch? Thanks!I know, v8.1.3 only fixed https://github.com/postcss/postcss-import/issues/168.
Yeah, I wasn’t thinking when I did that. I’m currently considering adding a
jspm
option to turn off jspm resolving; see https://github.com/postcss/postcss-import/issues/212.Can’t use this version with webpack:
All
require
calls in js files are broken.