-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Can't import SVG components from external packages #2236
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Sounds like a bug. Did it work before? |
Yep, it works fine with |
Cool. Want to dig into it? I'll have time later today but there are more pressing bugs which I'll likely look at first. |
Yep, I'm trying to investigate this bug. This works fine with local SVG components, only external packages are facing it, btw. |
I’d expect it to be related to #1305. |
This looks more like intended functionality than a bug. We don't compile 0.9.x used webpack 1 which did not support You'll need to fix Thanks! |
Thanks for response @Timer! Removing |
Thanks for the investigation. |
This crops up in the form of uglify errors during a production build, e.g. facebook#2236, facebook#2433, facebook#2475. The suggestion there is to transpile deps down to ES5 and/or remove `module`. However, `module` is there specifically to indicate ES module support, which uglify doesn't support, so ask webpack not to resolve it.
I'm experiencing a similar problem, can @Timer or @stepankuzmin add a bit more detail. How did you get the external module to compile ? |
@willowhq, the package that needed changed was controlled by @stepankuzmin. It was not a 3rd party package. I suggest you open an issue on the repository you're having issues with and ask them to fix their build so that it may be consumed by browsers. 😄 |
it's material- ui and I believe I've found the solution. |
If the solution is generic enough, sure! We could document it here. |
Uh oh!
There was an error while loading. Please reload this page.
Can you reproduce the problem with latest npm?
Yes, I can.
Description
Can't import react components that contain SVG elements like
<svg>
,<g>
, etc from external packages.Expected behavior
Files should be imported correctly.
Actual behavior
I'm getting
Environment
npm ls react-scripts
(if you haven’t ejected):node -v
:7.10.0
npm -v
:4.6.1
Operating system: macOS 10.12.5
Reproducible Demo
To reproduce this issue you can try to import any component from @urbica/components.
Eg.
FYI this library uses
jsnext:main
param inpackage.json
The text was updated successfully, but these errors were encountered: