Build folder keeps getting deleted every so often?

Problem description:
Every so often (couple of days) I will run into the error “MODULE_NOT_FOUND” when running node build, which runs index.js in the build folder. I then have to rerun npm run build, and then it works for the next couple of days. This issue would still prevail even if the repl was Always On, so that’s not the issue.

Expected behavior:
The build folder should never be deleted, and should remain the same until npm run build is ran again.

Actual behavior:
Server stops, as build folder is empty. I then have to go in and rerun npm run build, and then it works. The website needs to be up and running, or at least sleeping all of the time.

Steps to reproduce:
Create a sveltekit project in an empty nix environment. Build it using the node adapter. Run index.js from the build folder. This issue is inconsistent, so it may not happen everytime.

Bug appears at this link:
https://replit.com/@Infiniti20/DailyTrivia?v=1

Browser/OS/Device:
Chrome / Windows / AMD PC

An idea on how to fix this: add npm run build to npm’s start command, then make sure replit is calling npm start.

Hey @Infiniti20!

I am sorry to hear that you’re having issues with the build folder being deleted. When this happens, could you send me the timestamp that it happened in UTC so we can dig into our logs?

1 Like