.replit run command run 2 things at the same time

Hello people, i’m having trouble with .replit.

I’m attempting to run 2 commands at once, at the same time. I need both of them. Pocketbase is the backend, and vite is the frontend. I tried doing this (image below) it runs pocketbase, then stops it then runs vite. Is there any fix for this. I need them both on
image

Sup, @bddy! It looks like you need add the compile value. compile is basically the same as run, but it runs before run, here’s an example:

compile = "echo This is the cow"
run = "cowsay MOOO-"
1 Like

And instead of one ampersand (&) maybe try two (&&)? I have seen a lot of people using that.

1 Like

Hey, @RixTheTyrunt! I need both of them to run at the same time, will this do that?

@RixTheTyrunt I tried both of your solutions, none work. They all run pocketbase first, then waits for pocketbase to stop then runs vite.

I’m also facing the same issue. Both vite and pocketbase doesn’t run simultaneously.
Any solution yet ?

May have found a solution, but it looks like it will need to use an external script. Create a Bash script and change run to sh [scriptname].sh.

Inside of your Bash script, copy over the following:

./src/lib/pocketbase serve --http 0.0.0.0:8080 &
vite &

wait

This should run the two commands in parallel.

I could only test this using echo, but it seems to work OK. Let me know if this works out for you guys.

Edit: I just realized how old this topic was. Please make sure to create a new topic rather than replying to extremely old threads in the future.

2 Likes

I’ve tried it earlier, that didn’t work.
Only one of them works at a time for me :frowning:

Same goes for any WebView Output.
tried combinations : flask, streamlit, pocketbase, vite.