-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Static file importing in npm package is not working #6048
Comments
Hi, thanks for reporting - that sure looks like a bug. I'll pass it on to someone who can (hopefully) fix this! |
Thanks a lot! |
Nevermind, just found the logic we should follow for this: https://github.com/facebook/create-react-app/blob/bb64e31a81eb12d688c14713dce812143688750a/packages/babel-plugin-named-asset-import/index.test.js will change this tomorrow and disable svgr for now... |
Seems like the behavior of create-react-app is:
|
It works now! Thanks so much! |
🐛 bug report
Preflight Checklist
adheres to.
to file, without success.
Description of the problem
https://codesandbox.io/s/antd-mobile-static-file-test-1vv0d?file=/src/App.tsx
In this sandbox I used the
ErrorBlock
component from packageantd-mobile
. In theErrorBlock
component, there is a svg file import:But when I render this component in codesandbox, this svg image gets 404.
How has this issue affected you? What are you trying to accomplish?
I'm the maintainer of antd-mobile package. I'd like to make some demos about antd-mobile v5 alpha using codesandbox. But currently the svg images are broken.
To Reproduce
Just use the sandbox link below.
Link to sandbox: link (optional)
https://codesandbox.io/s/antd-mobile-static-file-test-1vv0d?file=/src/App.tsx
Your Environment
The text was updated successfully, but these errors were encountered: