Closed 0pt1m1z3r closed 5 years ago
Проще по русски написать :)
Ошибка возникает в get-module-chunk.js
, условие webpackVersion.IS_4
верно, хотя у меня стоит 3 вебпак.
Could you please create repo with minimal setup to demonstrate a problem (package.json, webpack config, SVG image and piece of your code). If you don't want to create a repository - you can create a gist with multiple files.
fixed..
Fixed in svg-sprite-loader@4.1.4
, please update
@kisenka I had to go back to the version svg-sprite-loader@4.1.3
because my Cypress was breaking after 4.1.3
.
It couldn't find the require.main.require('webpack...')
.
Although, the last version worked well with my App and storybook.
@williansabiao which NodeJS version is used?
The Cypress uses his own Node build. It's v8.2.1 😞 .
I just saw they are working on to update it. So, probably it is the reason I'm getting the error in the new versions of svg-sprite-loader
, right?
I guess I can update to a newer version when Cypress update as well. That's ok. Thanks.
Just wanted to highlight that this change (PR #314 ) breaks builds where webpack is started from a global Node.js application such as a global Gulp installation.
In that case the main entry point for Node.js will be the global Gulp and its paths (global paths) will be present in require.main.paths
. If you don't happen to have webpack globally installed the webpack lookup will fail.
I have found the following workarounds:
npx
or similarNot sure if this is a problem that this of concern for this module, but since others might encounter the same issue I post my findings here.
I'm also running into this problem when running ESLint (with eslint-import-resolver-webpack).
This line:
const webpackVersion = require.main.require('webpack/package.json').version;
Causes this error:
Error: Cannot find module 'webpack/package.json'
I use lerna and there is two directories: with builder and with sites. When I bootstrap builder to each site, this error is causing:
Error: Cannot find module 'webpack/package.json'
Is there any way to make it work with eslint-import-resolver-webpack?
@williansabiao @linqcan @Nettsentrisk @ivan-podgornov @ViieeS
Using autodetecting webpack version was very bad idea. I've published alpha version without detecting webpack version, could some of you guys help me with trying it out?
npm install svg-sprite-loader@drop-webpack-version-detector
@kisenka works fine! Thank you!
Make PR, please.
Published in svg-sprite-loader@4.2.6
Do you want to request a feature, report a bug or ask a question? Bug
What is the current behavior?
svg-sprite-loader
havewebpack 4
in dependencies.getWebpackVersion
return version for webpack in{project}/node_modules/svg-sprite-loader/node_modules/webpack/package.json
What is the expected behavior?
getWebpackVersion
should return version for webpack in{project}/node_modules/webpack/package.json
If the current behavior is a bug, please provide the steps to reproduce, at least part of webpack config with loader configuration and piece of your code. I just run my nuxt.js project and get this error:
Please tell us about your environment: