-
-
Notifications
You must be signed in to change notification settings - Fork 433
Open
Description
🐛 Bug Report
#332 fixed an issue generating component names with special characters. Though this fix does not seem to be used to generate export names in index files, which throws the following error:
> svgr-special-character-bug@1.0.0 build:icons ~/Git/svgr-special-character-bug
> svgr --out-dir icons -- svg
svg/Direction=Down.svg -> icons/Direction=down.js
~/Git/svgr-special-character-bug/node_modules/.pnpm/@svgr+cli@8.1.0/node_modules/@svgr/cli/dist/index.js:435
throw error;
^
SyntaxError: Unexpected token, expected "," (1:30)
> 1 | export { default as Direction=down } from './Direction=down'To Reproduce
- Add an icon with special characters in the file name (I've tested
=and→) - Run svgr cli
svgr --out-dir icons -- svg(in repropnpm build:icons), no special config - Generating the icon components works
- Generating the index file fails
Expected behavior
I expect index files to use the same getComponentName function to generate the export name to avoid issues with special characters.
Link to repl or repo (highly encouraged)
System Info
## System:
- OS: macOS 15.6
- CPU: (12) arm64 Apple M2 Pro
- Memory: 155.48 MB / 16.00 GB
- Shell: 5.9 - /bin/zsh
## Binaries:
- Node: 24.2.0 - /opt/homebrew/bin/node
- Yarn: 1.22.22 - /opt/homebrew/bin/yarn
- npm: 11.3.0 - /opt/homebrew/bin/npm
- pnpm: 10.10.0 - ~/Library/pnpm/pnpm
- bun: 1.1.43 - ~/.bun/bin/bun
## npmPackages:
- @svgr/cli: ^8.1.0 => 8.1.0
- @svgr/core: ^8.1.0 => 8.1.0 hsahu-rfhl
Metadata
Metadata
Assignees
Labels
No labels