-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
@svgr/cli generated exports incomplete / truncated #433
@svgr/cli generated exports incomplete / truncated #433
Comments
Hey @m7kvqbe1 👋, |
It's worth noting that i'm currently working around this issue using a little bit of my own Bash: #!/usr/bin/env bash
set -uo pipefail
trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
IFS=$'\n\t'
:> src/index.ts
for file in src/icons/*; do
filename=$(basename -- "$file")
filename_no_ext=${filename%%.*}
echo "export {default as Icon${filename_no_ext}} from './icons/${filename_no_ext}'" >> src/index.ts
done |
Hello @m7kvqbe1, thanks for this bug. I think the issue only occurs with |
🐛 Bug Report
The generated
index.tsx
exports file from the below command appears to be either incomplete or truncated. I get a different set of exports written to file each time I run the command. It looks like there is some kind of race condition going on.To Reproduce
Steps to reproduce the behavior:
Create multiple directories of SVG icons.
Run the following:
src/icons/index.tsx
Expected behavior
Exports for all of the generated React components are included within the
index.tsx
file.Link to repl or repo (highly encouraged)
Repro can be found here on this branch:
https://github.com/Royal-Navy/standards-toolkit/tree/repro/svgr-generated-exports-truncated/packages/icon-library
Env info
The text was updated successfully, but these errors were encountered: