We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Found an issue that was closed: #8606 No further help was commented on however and the help section on the Remix Docs didn't help either.
Comment from other Issue:
@pcattori I seem to have the same problem and the troubleshooting section didn't help.
I've a similar setup:
I have a package, which expects "@package/icons" to exist in the repository and in that packages lib build, it imports it:
import icons from "@package/icons/lib/icons/icons.symbols.svg";
In my Library, everything works fine.
In Remix, when I start my dev or build, I get the error: "[vite] Internal server error: Unknown file extension ".svg"
In my vite.config.ts I have an alias:
'@package/icons': resolve(__dirname, './node_modules/@package/icons'),
I've tried using the cjsInterop Package (however, I'm trying to reference a node_module svg here, not a JS File).
When I try to incorporate @brophdawg11 's suggestion with ssr.noExternal, I also get the error: [vite] Internal server error: module is not defined
So I'm currently at an impasse and can confirm that I, too, have the same problem importing non-JS-Files from external packages.
System: OS: macOS 14.4.1 CPU: (11) arm64 Apple M3 Pro Memory: 253.22 MB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm Browsers: Chrome: 124.0.6367.62 Edge: 123.0.2420.97 Safari: 17.4.1 npmPackages: @remix-run/dev: ^2.8.1 => 2.8.1 @remix-run/node: ^2.8.1 => 2.8.1 @remix-run/react: ^2.8.1 => 2.8.1 @remix-run/serve: ^2.8.1 => 2.8.1 vite: ^5.2.8 => 5.2.9
npm
Third-party SVGs should be able to be impored
Third-party (node_module package) SVGs can't be imported
The text was updated successfully, but these errors were encountered:
Could you provide a minimal reproduction?
Sorry, something went wrong.
@brophdawg11 in the original issue #8606 there is a stackblitz link: https://stackblitz.com/edit/vitejs-vite-u1xsya
I've also noticed that if I link the package, everything works fine. Only when I install the package it fails. If that helps.
I've visualized the dependencies for clarity:
No branches or pull requests
Reproduction
Found an issue that was closed: #8606
No further help was commented on however and the help section on the Remix Docs didn't help either.
Comment from other Issue:
@pcattori I seem to have the same problem and the troubleshooting section didn't help.
I've a similar setup:
I have a package, which expects "@package/icons" to exist in the repository and in that packages lib build, it imports it:
In my Library, everything works fine.
In Remix, when I start my dev or build, I get the error:
"[vite] Internal server error: Unknown file extension ".svg"
In my vite.config.ts I have an alias:
I've tried using the cjsInterop Package (however, I'm trying to reference a node_module svg here, not a JS File).
When I try to incorporate @brophdawg11 's suggestion with ssr.noExternal, I also get the error:
[vite] Internal server error: module is not defined
So I'm currently at an impasse and can confirm that I, too, have the same problem importing non-JS-Files from external packages.
System Info
Used Package Manager
npm
Expected Behavior
Third-party SVGs should be able to be impored
Actual Behavior
Third-party (node_module package) SVGs can't be imported
The text was updated successfully, but these errors were encountered: