[Glitch-Community] Generate cache


#1

I’m trying to contribute to https://github.com/FogCreek/Glitch-Community but I’m having trouble building the project. This is the error I get when I run webpack-cli:

ERROR in ./src/presenters/pages/router.jsx
Module not found: Error: Can't resolve '../../cache/categories' in '/home/.../Glitch-Community/src/presenters/pages'
 @ ./src/presenters/pages/router.jsx 23:18-51
 @ ./src/client.jsx

ERROR in ./src/presenters/categories.jsx
Module not found: Error: Can't resolve '../cache/categories' in '/home/.../Glitch-Community/src/presenters'
 @ ./src/presenters/categories.jsx 9:18-48
 @ ./src/presenters/pages/index.jsx
 @ ./src/presenters/pages/router.jsx
 @ ./src/client.jsx

If I remix the project I see that the cache folder is already present. But there seems to be a chicken/egg problem. It seems like the app expects the cache files to already exist. Running cache.js and server.js directly doesn’t seem to help.


#2

Hi,

The site is primarily developed in Glitch itself. Though we are able run it locally, we don’t. If you remix from ~community and use Glitch to author your contributions (see Contributing.MD for more details), you should be in pretty good shape.

If you’d really like to run the site locally, you’ll need to start up the project in approximately the same way that Glitch does:

 pnpm install
 pnpx run prestart &
 pnpx run start

That should be about right; the intent is to run the ‘prestart’ and ‘start’ scripts as defined in package.json.

Let me know if this works out for you. That said, feel free to develop straight in Glitch itself – it’s what we do, and we’ve tuned the site for that :slight_smile:

– Jude


#3

Also, with regards to ‘cache’ specifically, it’s generated by the webserver; if your run node server.js (and it comes online), you should see the cache populate. That cache is not long for this world :wink:


#4

Hi, thanks for the response. The scripts just call bash sh/watchers.sh and nodemon ./server/server.js --watch server --watch views -L respectively which has the same issue as before. But I’ll use the site from now on.