SSR pages are not getting their resources (<link>
/ <style>
/ <script>
tags) bundled and optimized with the serve command
#1098
Milestone
Type of Change
Bug
Summary
After upgrading to v0.28.0, noticed that when introduced API routes into a "static" project, this combination triggers the hybrid server, but the HTML coming back is showing a bunch of 404s because none of the assets were loading correctly in the browser.
The reason for this is it looks like all the paths (from a template) were pointing to the development paths and so of course everything is broken as a result.
Details
The issue after some debugging appears to be that when an SSR page goes into its optimization phase, none of the
imports
are there because graph.json is written before all the files are bundled. The simple solution is to just re-serialize graph.json during the bundling phase to get that latest state.My concern is that these imports are built up from
modelResource
, which will also have a ton of raw contents, which would significantly bloat graph.json, so should keep that in mind.Should also make sure this can be tested.
The text was updated successfully, but these errors were encountered: