Skip to content
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

SSR pages with prerender configuration are not getting served from static HTML #1099

Closed
thescientist13 opened this issue Apr 15, 2023 · 0 comments · Fixed by #1101
Closed
Assignees
Labels
bug Something isn't working CLI P0 Critical issue that should get addressed ASAP SSR v0.28.1
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Apr 15, 2023

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 and now the HTML coming back for the home page is showing a bunch of 404s because it is being served from index.js instead of the static index.html output. (which actually revealed another bug).

Screen Shot 2023-04-15 at 2 25 03 PM

<link rel="stylesheet" href="../styles/main.css" data-gwd-opt="inline">
          
<script type="module" data-gwd-opt="static" src="../components/footer/footer.js"></script>
<script type="module" data-gwd-opt="static" src="../components/header/header.js"></script>
<script type="module" src="../components/nav/nav.js"></script>
<script type="module" src="../components/video-card/video-card.js"></script>

As a note, seems like these shouldn't be returning a 500 though, should be a 404.

Details

However, what is key to note about the difference between this and #1098 is that this project has prerender: true in its greenwood.config.js which means this page should not be serving from index.js. The output index.html is correctly bundled, and that is what should be being served.

In fact, there's no reason for this to even need a bundled index.js in the first place.

% tree public
public
├── 2002200397.827098fd.js.map
├── 404
├── 404.html
├── _index.js
├── _templates
│   └── app.html
├── api
│   ├── assets
│   │   └── video-card-8a4d9eb0.js
│   ├── fragment.js
│   └── greeting.js
├── assets
│   ├── fonts
│   │   └── coop-bl.woff2
│   ├── icons
│   │   ├── facebook.svg
│   │   ├── spotify.svg
│   │   └── youtube.svg
│   ├── images
│   │   ├── avatar-dave.webp
│   │   ├── avatar-erika.webp
│   │   ├── avatar-owen.webp
│   │   └── avatar-tunesy.webp
│   ├── tuesdays-tunes-og.png
│   ├── tuesdays-tunes.webp
│   └── tunesy.webp
├── contact
│   └── index.html
├── favicon.ico
├── footer.5d06a040.js.map
├── graph.json
├── header.ebe96d78.js.map
├── index.html
├── index.js
├── manifest.json
├── nav.97858d20.js
├── nav.97858d20.js.map
├── resources.json
├── styles
├── video-card.1048ec31.js
└── video-card.1048ec31.js.map

10 directories, 31 files
@thescientist13 thescientist13 added bug Something isn't working SSR v0.28.1 labels Apr 15, 2023
@thescientist13 thescientist13 added this to the 1.0 milestone Apr 15, 2023
@thescientist13 thescientist13 self-assigned this Apr 15, 2023
@thescientist13 thescientist13 changed the title SSR pages with prerender configuration are not getting served from static HTML SSR pages with prerender configuration are not getting served from static HTML Apr 15, 2023
@thescientist13 thescientist13 moved this from 🏗 In progress to 👀 In review in [Greenwood] Phase 9 - Standards and Conventions Apr 26, 2023
@thescientist13 thescientist13 added the P0 Critical issue that should get addressed ASAP label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI P0 Critical issue that should get addressed ASAP SSR v0.28.1
Projects
No open projects
1 participant