GitbookIO / GitbookIO/gitbook

Cannot launch locally on Windows: Internal Server Error for the site with only default contents

Open
#2,518 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
29k
Forks
4k
Avg merge
1d 2h
Merged PRs (30d)
71

Description

Disclaimer: I am very new to gitbook.

I have created a very basic docs site, containing the default contents only. It is published at https://borlander.gitbook.io/borlander-docs, and I am trying to launch the local frontend against this site, following, exactly, the steps from Readme.md.

  • I am on Windows
  • have cloned the gitbook main branch, at commit f9a075eed1
  • using node 20.6.1
$> nvm use 20.6                                                                                                                                                         
Now using node v20.6.1 (64-bit)
  • bun install
$>bun install                                                                                                                                                          
bun install v1.1.30 (7996d06b)
warn: GET https://npm.fontawesome.com/@awesome.me/kit-a463935e93/-/1.0.8/kit-a463935e93-1.0.8.tgz - 401

Checked 1721 installs across 1654 packages (no changes) [444.00ms]                                                                               
  • bun dev
    ... all looks good

  • open http://localhost:3000/borlander.gitbook.io/borlander-docs/basics/markdown in Chrome

=>

  • Page shows Internal Server Error
  • The bun console for gitbook#dev node shows, among a lot of traces, the following error:
│trace cloudflareDO.get(api.getSite("eiNZhKOsBTlOrNF2raBT","site_VPQBq")) 2.612900000065565ms {}
│trace cloudflareDO.get(api.getSiteSpaces(21f175f9b562a4c26a8706c241f1c6275e23c589)) 2.767099999822676ms {}                                                                       
│trace cloudflareDO.get(api.getSiteCustomizationById("eiNZhKOsBTlOrNF2raBT","site_VPQBq")) 2.930200000293553ms {}                                                                 
│ ⨯ Internal error: TypeError: Cannot read properties of undefined (reading 'default')                                                                                            
│    at resolveClientReference (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.develop                                    │ent.js:87:55)                                                                                      
│    at resolveModule (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:1                                    │67:35)                                                                                                                                                                           
│    at processFullRow (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:                                    │740:25)                                                                                                                                                                          
│    at processBinaryChunk (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development                                    │js:1858:21)                                                                                                                                                                      
│    at progress (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:1926:1                                    │)                                                                                                                                                                                
│digest: "1732920403"                                                                                                                                                             
│[TypeError: Cannot read properties of undefined (reading 'default')]                                                                                                             
│ ⨯ [TypeError: Cannot read properties of undefined (reading 'default')]                                                                                                          
│ ⨯ [TypeError: Cannot read properties of null (reading 'default')]                                                                                                               
│ GET /borlander.gitbook.io/borlander-docs/basics/markdown 500 in 6051ms                                                                                                          
│ ✓ Compiled in 1231ms (1337 modules)                                                                                                                                             
│trace cloudflareDO.set(api.getSiteIntegrationScripts("eiNZhKOsBTlOrNF2raBT","site_VPQBq")) 0.08810000028461218ms {}                                                              
│trace cache.setCacheEntry(api.getSiteIntegrationScripts("eiNZhKOsBTlOrNF2raBT","site_VPQBq")) 0.5449999999254942ms {}                          

Screenshot:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Readme.md and reproduce the Windows setup using Node 20.6.1, bun install, and bun dev, then load the reported local URL. Trace the Cannot read properties of undefined (reading 'default') error through the Next.js React server rendering path; done means the default-content page renders locally without a 500 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, next.js, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.