Skip to content

@svgr/cli generated exports incomplete / truncated #433

@m7kvqbe1

Description

@m7kvqbe1

🐛 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:

  1. Create multiple directories of SVG icons.

  2. Run the following:

rm -rf src/icons; svgr --ext tsx -d src/icons src/assets/**/
  1. Note the generated exports in 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

## System:
 - OS: macOS 10.15.3
 - CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
 - Memory: 90.29 MB / 16.00 GB
 - Shell: 5.7.1 - /bin/zsh
## Binaries:
 - Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
 - Yarn: 1.19.1 - ~/.yarn/bin/yarn
 - npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions