Skip to content

Problem 404 css/js files in my Laravel APP php+vite #1296

Discussion options

You must be logged in to vote

Hello @NicolasKulka , I have finally got my Laravel + Vite webapp working on Vercel.
Thanks to @NsonguruaJohnson for the idea regarding the build routes and I have reconfigured it to my liking.

Github Repo: vercel.json
Vercel webapp: Tempestas

In my routes on vercel.json
"routes": [ { "src": "/build/(.*)", "dest": "/public/build/" }, { "src": "/(.*)", "dest": "/api/index.php" } ],

The src value is my Vercel webapp output
The dest is the Laravel directory

src: /build/(.*) means everything on /build Vercel output folder is passed to dest
dest: /public/build/ means Laravel directory and the src is passed here

With these sequence/pattern, I can even put my images in my public/resources folder…

Replies: 15 comments 20 replies

Comment options

You must be logged in to vote
1 reply
@josetorronteras
Comment options

Comment options

You must be logged in to vote
2 replies
@josetorronteras
Comment options

@josetorronteras
Comment options

Comment options

You must be logged in to vote
1 reply
@josetorronteras
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@josetorronteras
Comment options

@NicolasKulka
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@NsonguruaJohnson
Comment options

@NicolasKulka
Comment options

@NsonguruaJohnson
Comment options

@NicolasKulka
Comment options

Comment options

You must be logged in to vote
3 replies
@NsonguruaJohnson
Comment options

@LingMyat
Comment options

@Jeppenseppiro
Comment options

Answer selected by NicolasKulka
Comment options

You must be logged in to vote
4 replies
@NsonguruaJohnson
Comment options

@NicolasKulka
Comment options

@Jeppenseppiro
Comment options

@ElvisAns
Comment options

Comment options

You must be logged in to vote
3 replies
@Jeppenseppiro
Comment options

@jornatf
Comment options

@Jeppenseppiro
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment