-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
build/server/assets is empty on production build #13540
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
Comments
I'm not sure why the output prints that those were generated to |
This happens even in your example https://stackblitz.com/edit/github-3rxnof8n
![]()
![]()
![]() |
So did I :) The stackblitz works fine for me on a bunch of reloads - no issues loading any assets: Again, there must be something on on for you locally. Please provide a minimal reproduction in a github repo we can clone and install to remove Stackblit from the equation as well. |
I also have those assets load up just fine in my browser. The logical assumption is the problem is occuring in your browser. Most likely it is some sort of browser extension that is blocking them from loading. It could possibly be a firewall as well. Regardless, that isn't a bug in the library. |
After some conversations with my colleagues, I finally realized my misunderstanding of the React Router approach to SSR. In my mind, SSR meant complete server-side rendering — like inlining all CSS and static assets into the HTML — so that we’d get a fully ready layout without any extra network requests for static assets. Sorry for wasting your time, guys. |
@yashok111 No worries. This actually highlighted to me that we could be more transparent with how we're handling assets in the server build. I've opened a PR improving our build logs: #13547 |
I'm using React Router as a...
framework
Reproduction
The Default React Router template can be used for reproduction. Just create a new project with
npx create-react-router@latest --template remix-run/react-router-templates/default
. Then runbuild
script. In console you will see build logs like on screenshot that assumes that static assets were emitted toassets
folder.But when you try to list files inside
assets
folder it actually empty. This issue leads to incorrect server side rendered layout.On last screenshot you can see actual server rendered html. No css styles and svg's
System Info
Used Package Manager
yarn
Expected Behavior
Server Side rendered output can access static assets generated by production build
Actual Behavior
Server build static assets is missing
The text was updated successfully, but these errors were encountered: