-
Notifications
You must be signed in to change notification settings - Fork 9
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
Cannot build using ?url
imports
#55
Comments
Also when using this strategy to import css - HMR does not work. Using side-effect import works fine. |
This might be solved in
Wasn't able to reproduce this issue, both in tests and 🤔 I'll close for now, let me know if that worked! |
Can confirm |
Found a problem, it is related to the use of preload link: on initial dev startup: <link rel="preload" href="/app/styles/index.css" as="style"> after hmr update: <link rel="preload" href="http://localhost:3000/app/styles/index.css?t=1711437214384" as="style"> So that's definitely a problem with remix. In the meantime, we can disable preloading for dev mode: export const links: LinksFunction = () => [
...(!import.meta.env.DEV ? [{ rel: 'preload', href: $styles, as: 'style' }] : []),
]; |
The Vite
?url
import (vitejs/vite#15259) is used to manually include the asset URL without a side-effect import.Running
pnpm dev
is fine, but the production build failed.Stackblitz (https://stackblitz.com/edit/remix-run-remix-mqrbqi?file=app%2Froot.tsx)
Console output:
The text was updated successfully, but these errors were encountered: