spacefold icon indicating copy to clipboard operation
spacefold copied to clipboard

Failed on Running the Spacefold Demo Locally

Open orbxball opened this issue 4 years ago • 2 comments

I followed the instructions of ``Running the Spacefold Demo Locally'' but it failed with JSON parsing error.

>> yarn build
yarn run v1.22.10
$ next build && next export
info  - Creating an optimized production build
info  - Compiled successfully

> Build error occurred
SyntaxError: Unexpected token u in JSON at position 0

The commands I ran are

  1. clean clone this repo and then cd in
  2. yarn install
  3. yarn build -> trigger error 3.1. if I skip 3. to run yarn start, it tells me there's no build file.
>> yarn start
yarn run v1.22.10
$ next start
Error: Could not find a production build in the '$HOME/spacefold/.next' directory. Try building your app with 'next build' before starting the production server. https://err.sh/vercel/next.js/production-start-no-build-id

Can someone point me out how to build it? appreciate it!

orbxball avatar Jan 13 '21 17:01 orbxball

Yikes, these instructions were horribly outdated. I just updated. Please give it another shot!

rhlsthrm avatar Jan 13 '21 17:01 rhlsthrm

It works! Thanks for your help. I have another question. When running npm run dev, compiling/building starts only after localhost:3000 is open, so there's a long waiting time for compilation before the page is ready. Is that possible to pre-build/compile all config file, so that next time npm run dev can open the page quicker?

>> npm run dev

> [email protected] dev $HOME/spacefold
> next dev

ready - started server on http://localhost:3000
event - compiled successfully  <= All these 4 start after localhost:300 is open
event - build page: /          <= 
wait  - compiling...           <= compilation take like 1min or so
event - compiled successfully  <=

orbxball avatar Jan 15 '21 15:01 orbxball