Solution skill
SVG via svgr support
Complete solution
Shows how to fix sVG via svgr support. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Mac ### Describe the Bug In Next.js, I use the SVG image include using the svgr webpack plugin. `typescript // SiteLogo.svg import LogoImage from 'public/images/logo.svg'; Next.js config: ``js // next.config.js const nextConfig = { reactStrictMode: true, swcMinify: true, experimental: { appDir: true, }, webpack(config) { // Support SVG (aviable ) config.module.rules.push({ test: /\.
Steps
- Issue vercel/turborepo#4832 (closed, 35 comments): ### What version of Turborepo are you using? next@13.4.1 ### What package manager are you using / does the bug impact? npm ### What operating system are you using? Mac ### Describe the Bug In Next.js, I use the SVG image include using the svgr webpack plugin.
2. Next.js config: ```js // next.config.js const nextConfig = { reactStrictMode: true, swcMinify: true, experimental: { appDir: true, }, webpack(config) { // Support SVG (aviable ) config.module.rules.push({ test: /\.
3. If SVG imports break under Turbopack ('Module parse failed'), add an SVGR rule to your Next.js config: under turbopack.rules, map '*.svg' to loaders ['@svgr/webpack'] with as '*.js'. On Next 15.3 and later this lives at the top-level turbopack key; on older versions it was under experimental.turbo. Multiple users confirmed this fixes it.
## When to use
You are seeing this: Issue vercel/turborepo#4832 (closed, 35 comments): ### What version of Turborepo are you using? next@13.4.1 ### What package manager are you using / does the bug impact? npm ### What operating system are you using? Use this skill when you run into "SVG via svgr support".
## When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
## Versions
Versions mentioned in the source: next 13.4.1. If you are on something much newer or older, the details may have shifted.
## Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
## Sources
- https://github.com/vercel/turborepo/issues/4832
Evidence
In gh:vercel/turborepo#4832, the reporter ran into: Issue vercel/turborepo#4832 (closed, 35 comments): ### What version of Turborepo are you using? next@13.4.1 ### What package manager are you using / does the bug impact? npm ### What operating system are you using? Mac ### Describe the Bug In Next.js, I use the SVG image include using the svgr webpack plugin. ``typescript // SiteLogo.svg import LogoImage from 'public/images/logo.svg'; Next.js config: ``js // next.config.js const nextConfig = { reactStrictMode: true, swcMinify: true, experimental: { appDir: true, }, webpack(config) { // Support SVG (aviable ) config.module.rules.push({... The verified answer was: If SVG imports break under Turbopack ('Module parse failed'), add an SVGR rule to your Next.js config: under turbopack.rules, map '.svg' to loaders ['@svgr/webpack'] with as '.js'. On Next 15.3 and later this lives at the top-level turbopack key; on older versions it was under experimental.turbo. Multiple users confirmed this fixes it. Source issue: https://github.com/vercel/turborepo/issues/4832
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_DXktetjxlPCbwqbMqlA43Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">SVG via svgr support <span>— Vectle</span></a>