Latest NextJS (10.1.4-canary.6) with Webpack 5 enabled fails: error - ./some-icon.svg?sprite TypeError: Cannot read property 'version' of undefined
See original GitHub issueWhat?
Hi, I’m trying to update my NextJS project from 10.0.5-canary.3
to 10.1.4-canary.6. And I’m enabling Webpack 5.
The feature that I’m using from next-optimized-images
is the SVG
sprite generation.
After remove node_modules
and start Next project again in dev mode I see this error on the console:
error - ./components/Footer/logo-footer.svg?sprite
TypeError: Cannot read property 'version' of undefined
event - build page: /next/dist/pages/_error
Did anyone found this problem?
This is my next.cofig.js
const withPlugins = require('next-compose-plugins')
const optimizedImages = require('next-optimized-images')
const nextConfig = {
distDir: 'next-server',
future: { webpack5: true },
}
module.exports = withPlugins(
[
[
optimizedImages,
{
imagesFolder: 'images',
imagesName: '[name]-[hash].[ext]',
handleImages: ['svg', 'png'],
svgo: {}
}
]
],
nextConfig
)
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Bountysource
Latest NextJS (10.1.4-canary.6) with Webpack 5 enabled fails: error - ./some-icon.svg?sprite TypeError: Cannot read property 'version' of undefined.
Read more >Firmware 1.12.0 version to CUAV X7 - PX4/PX4-Autopilot
Issue Title Created Date Comment Count Updated Date
fast‑export does not follow last stored state 0 2021‑02‑18 2022‑09‑26
Document `‑f` Argument to mega‑linter‑runner 0 2022‑09‑21...
Read more >Cyrilwanner Next-Optimized-Images Statistics & Issues - Codesti
Latest NextJS (10.1.4-canary.6) with Webpack 5 enabled fails: error - ./some-icon.svg?sprite TypeError: Cannot read property 'version' of undefined, open, 5 ...
Read more >Cyril Wanner next-optimized-images Issues - Giters
Latest NextJS (10.1.4-canary.6) with Webpack 5 enabled fails: error - ./some-icon.svg?sprite TypeError: Cannot read property 'version' of undefined.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s an issue in the underlying repo. A PR is already prepared: https://github.com/JetBrains/svg-sprite-loader/pull/452.
You can use patch-package to apply this fix locally in case the PR isn’t merged yet.
Let me check and I’ll close it : )