godaddy / svgs

svgs is a compatiblity layer between svg and react-native-svg
MIT License
191 stars 31 forks source link

Server rendering broken with module declaration #36

Open MrLoh opened 5 years ago

MrLoh commented 5 years ago

Since the module entry point declaration was added in v4.0 this library can't be used in a server rendering context anymore, as node will choose the module entry point which contains uncompiled JSX. If there is no particular reason to have the module export point to an uncompiled version, it should be removed or point to a compiled version

3rd-Eden commented 5 years ago

That is odd, as Node.js should be using main as entry point, not module.

3rd-Eden commented 5 years ago

Do you have steps to reproduce? Simply requiring the svgs module in the node cli works as intented.

MrLoh commented 5 years ago

@3rd-Eden hmm, I am using razzle which uses web pack on both ends. I can't share my code since it's private, but editing the package.json of svgs in my node_modules fixes the issue. Any reason you don't just provide a compiled version of the lib?