excaliburjs/excaliburjs.github.io

Bugs when trying to run the site locally

tsxoxo opened this issue · 6 comments

Heyhey!

TLDR;

In addition to the README instructions, I had to do two things to get the site running locally:

  1. npm i event-source-polyfill
  2. Add a null-check to /src/DocsPageTemplate.js

PR coming.

More info

I was following the README. I ran npm i. The errors appeared in succession, the second came after I had fixed the first one.

  1. First this, when running npm run develop. After running npm i event-source-polyfill, Gatsby managed to build. EDIT: Tested this again and this does not happen if I omit npm i. I can simply clone the repo, run npm run develop and the site seems to be working (still produces the error 2 tho).
    EDIT 2: Now I'm getting the error even before npm i. Not sure what's happening.
    Screenshot 2021-10-29 at 14 00 52

  2. Then I got this in the browser, which only seemed to be happening on the /docs route. After applying a null-check, it went away.
    Screenshot 2021-10-29 at 14 08 29

Null-check:

/src/DocsPageTemplate.js

54 -!!headings.length && (
54 +{headings && !!headings.length && (


Not sure if my fixes really fix this, but they got the site running on my machine, which really helped with writing documentation.

Since I have it ready, I will submit a PR incorporating these two changes, in case it helps.
EDIT: Since error 1 seems convoluted, I will leave that fix out from my PR until further discussion.

@kamranayub thoughts on these errors? Is this potentially something that we need better CI checks for after a renovate update?

@Return180bpm Out of curiosity what platform are you running on (mac, linux, windows, etc)? I wonder if some of this was hidden by the team mostly running windows.

I'm definitely all about an easy local experience, so I'm very interesting in fixing anything that gets in the way.

Another thought, will Gatsby 3 #112 improve the dev experience here as well?

Yes, I think because CI checks aren't running we must have merged some breaking changes to local development accidentally. Also, the event source polyfill ONLY applies locally so even a CI build wouldn't have caught it.

At any rate, my new PR will fix all this because we'll have the latest stuff.

So just focusing on the docs update is fine here.

Not sure if relevant anymore but here it goes :=)

I was running this on
macOS Big Sur 11.6
VSCode 1.61
Node v14.18.1

Just for reference, I'm getting a similar null error on /getting-started:
Screenshot 2021-10-30 at 19 54 26

This should be fixed, a PR was merged over the weekend that I tested and worked with local dev. I will close for now unless it becomes an issue again. The latest code runs on Node 16.