Deployment JS problem

Hi guys,

I have always been working on my Replit project through always alive. However having read that it will be deprecated in January I decided to move my bot to a VM. However a strange thing happens, in my code it can’t access JS files anymore, am I doing something wrong?

previous_hour = (now - dt.timedelta(hours=1)).strftime("%H:00")
          schedule[previous_hour] = 0

          with open('game_schedule.json', 'w') as file:
              json.dump(schedule, file)

Do you mean JSON (JavaScript Object Notation) instead of JS (JavaScript)?

The reason is, deployments don’t have persistent file systems, meaning you can’t write to a JSON (or any other) file.

1 Like

Yes, sorry. I meant JSON.

This is a huge problem.

How can I solve it?

There isn’t anything we can do right now. Staff have mentioned that they are working on a solution, though.

By any chance can you suggest a possibility at the code level?

You could use a database instead of a JSON file. I would recommend Replit DB, but that doesn’t work for deployments right now (and I don’t know if that’ll be fixed).

1 Like

cough cough I now must plug, for the 5th time today, Google Firebase.

1 Like

The problem with Replit DB is solved with Replit 3.3.X

But the problem is that I collect Survey through the Bot into a JSON file
It’s impossible to use a DB for that

Maybe the Spreadsheet but the problem are the API in this case

Could use a PostgreSQL database. Neon is a great free PostgreSQL database provider.

That seems to have a pretty steep learning curve though, right?

…Google Firebase Realtime Database is JSON-based, so you can set a value as a JSON object and get it back as JSON, but also get specific keys and values without having to directly sift through a JSON object (which, it kinda is, but that’s besides the point)