Skip to content
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

fix(react): load svg component in buildable library #12226

merged 1 commit into from Dec 19, 2022


Copy link

@YehudaGold YehudaGold commented Sep 25, 2022

Added svg and url loaders to rollup config of buildable react library, like in webpack config for react app (packages/react/plugins/webpack.ts).

Current Behavior

A new library with nx g @nrwl/react:lib which tries to import svg files fails with the error below

Error during bundle: Error: 'ReactComponent' is not exported by <path/to/svg>

Expected Behavior

Build should be sucessful

Related Issue(s)

Fixes #6761

Copy link

vercel bot commented Sep 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev Ready (Inspect) Visit Preview Dec 19, 2022 at 3:12PM (UTC)

Copy link
Contributor Author

Hey, is there anything I can do to advance this pull request?

Copy link

Any updates when this could be merged? I am seeing this problem with the latest nx version as well

Copy link

any updates on this, please? it's a real problem

Copy link

nx-cloud bot commented Dec 19, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 63761a5. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

🟥 Failed Commands
nx depcheck --no-dte
Successfully ran 18 targets

Sent with 💌 from NxCloud.

@jaysoo jaysoo force-pushed the bugfix/react-lib-svg branch 2 times, most recently from 5351189 to 6cfc370 Compare December 19, 2022 14:58
added svg and url loaders to rollup config of buildabel react library, like in webpack for react app.

ISSUES CLOSED: nrwl#6761
@jaysoo jaysoo merged commit 6a28842 into nrwl:master Dec 19, 2022
13 checks passed
@YehudaGold YehudaGold deleted the bugfix/react-lib-svg branch December 23, 2022 13:22
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

Successfully merging this pull request may close these issues.

'ReactComponent' is not exported by lib
4 participants