-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remix 1.16 unstable_dev
- problems with assets
#6271
Comments
Just to note I'm also receiving the same "Domains, protocols and ports must match." error, and 404 errors on objects in the public folder (like fonts). |
@pcattori I saw in the merge that SVGs will be inlined and I'm not a fun of this solution. It will inflate HTML and could cause some unexpected behaviour only in "dev" making it harder to debug. |
@arekbartnik unfortunately there is no way for The alternative would be to proxy everything from our dev server, but that would require rearchitecting parts of the dev server. I'm happy to consider doing that, but that will take longer. In the meantime, inlining via Data URLs does the job. |
@pcattori I would like to understand why it was decided to serve files from a different origin? I think it's could be especially painful because "production" will be different (most assets are relative.) |
Its so that HMR updates can safely be sent immediately to the browser without needing to wait for the app server to reboot. So even during app server "downtime", assets will continue to be served. |
@pcattori I've checked and svgs as dataulrs are blocked in Safari. Works in Chrome and Firefox. Here's a pen https://codepen.io/arekbartnik/pen/QWZqXzJ But I think using |
🤖 Hello there, We just published version Thanks! |
@arekbartnik after some more thought, I realized that serving the assets from the dev server doesn't actually help all that much for making HMR faster (for complicated reasons I won't bring up here). Which means that the original purpose of serving assets from dev server is obsoleted. Going to think about this a little more, but leaning towards just serving everything from the app server. Simpler, more similar to prod, and only one domain, so no CORS or cross-domain shenanigans. No need to use dataurls for svgs. |
Related: #6306 |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
1.16
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
git clone git@github.com:ArekBartnik/remix-116-dev-assets.git
npm i
npm run dev
http://localhost:3000
Expected Behavior
It should show a page using Inter font and an icon after "Welcome to Remix".
unstable_dev: true;
unstable_dev: true
Without new devserver paths to assets are relative but after turning this flag they change to absolute.
Actual Behavior
There're 2 errors:
http://localhost:3001/fonts/InterV.var.woff2 net::ERR_ABORTED 404 (Not Found)
The text was updated successfully, but these errors were encountered: