You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ES module build contains CommonJS files (extract/transform.js, transformToRn.js), breaking native-ESM dev servers #3127
In 15.16.1, two files in the ES module build are still CommonJS, while other files in that build import them with named ES imports:
lib/module/lib/extract/transform.js and lib/module/lib/extract/transformToRn.js (PEG.js output) end with module.exports = { SyntaxError: peg$SyntaxError, parse: peg$parse }.
lib/module/lib/extract/extractTransform.js does import { parse } from './transform'; and import { parse as parseTransformSvgToRnStyle } from './transformToRn';.
Bundlers that interoperate CommonJS and ESM (Metro, Rollup/Rolldown in a production build) handle this. A dev server that serves the module build as native ESM does not. With react-native-web under Vite 8, with react-native-svg in optimizeDeps.exclude (needed because pre-bundling follows react-native imports into Flow sources), the browser fails with:
SyntaxError: The requested module '/node_modules/react-native-svg/lib/module/lib/extract/transform.js' does not provide an export named 'parse'
Steps to reproduce
A react-native-web app under Vite 8 that imports react-native-svg 15.16.1, with optimizeDeps.exclude: ['react-native-svg', ...].
vite (dev server), open the page.
The error above; production vite build works.
Expected
The module build is ESM throughout, e.g. the two generated parsers emit export { peg$SyntaxError as SyntaxError, peg$parse as parse } (or are wrapped by a small ESM re-export).
Versions
react-native-svg 15.16.1, react-native-web 0.21, Vite 8.3.8 (Rolldown), Node 26.
Activity
github-actions commentedon Nov 14, 2026
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
github-actions commentedon Nov 14, 2026
Hey! 👋
It looks like you've omitted a few important sections from the issue template.
Please complete Snack or a link to a repository, SVG version, React Native version and Platforms sections.