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

#451: Fallback to using webpack version instead of package.json version #452

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

LuudJanssen
Copy link
Contributor

What kind of change does this PR introduce? (bugfix, feature, docs update, improvement)
This is a bugfix for issue #451

What is the current behavior? (You can also link to an open issue here)
Using svg-sprite-loader with Next.js version 10.1.x in combination with enabling Webpack 5 results in the following error:

TypeError: Cannot read property 'version' of undefined

What is the new behavior (if this is a feature change)?
Check if we can use the version in the package.json file and otherwise fallback to using the webpack object itself which contains a version property.

Does this PR introduce a breaking change?
No.

Please check if the PR fulfills contributing guidelines
I can't run the tests, nor the linter myself. When installing ESLint (which probably should be in the devDependencies) I got lint errors on files I didn't touch. I checked the code style myself and everything seems to match.

I'm on Windows so nor the build script nor any of the test commands worked for me.

@LuudJanssen LuudJanssen changed the title fix(utils): use webpack object version if package can't be required #451: Fallback to using webpack version instead of package.json version Apr 21, 2021
@d3x42 d3x42 self-requested a review April 21, 2021 18:47
Copy link

@andresgutgon andresgutgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks!

@LuudJanssen
Copy link
Contributor Author

Just noticed Prettier changed all formatting to my code standards, not yours, so I'll update the PR according to your code styles, which will probably also fix the failing pipeline.

@pangxiaolong
Copy link

Nice! Thanks!

I desperately hope that this problem will be resolved.
Thanks!

@LuudJanssen
Copy link
Contributor Author

Hi @andresgutgon & @d3x42, I updated the PR to match the code style. I had to ignore several ESLint rules, because I didn't see another way of importing webpack.

@andresgutgon
Copy link

LGTM go go!

@d3x42 d3x42 merged commit f4b82c2 into JetBrains:master Apr 23, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants