protonemedia/laravel-splade

Blank page after build

Closed this issue · 5 comments

I'm building an app with laravel 10 and splade.
First I started on a localhost and by running npm run dev & php artisan serv everything worked fine.
Now I am trying to upload it to a server but by running npm run build I get a blank page.
What am I doing wrong?
Thank you

I have the same problem here.
Laravel 10 + Splade/Jetstream. Everything works fine with npm run dev + php artisan serve (except a flash of unstyled content - which is certainly caused by run dev).
When I run npm run build, I also got a blank page. A look at page's source : everything is here in the code, but the page is blank.
Don't know where to start searching.

The error I've got is in :

function ve(e, t, n, r) {
        const s = e
          , i = new SyntaxError(String(s));
        return i.code = e,
        i.loc = t,
        i
    } 

image

don't know @emiku90 if you got the same error ?

Related to #191

Probably a mistake in your blade template such as a non-closed <div> or something like that. When that happens to me, I just try to find the error by removing some code on the page, see if the issue is in this part of the code or not. But I agree that it would be better to get more informative error messages.

@romain-lgr is right, it's almost always a syntax error within the template. In development, Vue lets you know in the console, but in production, it throws an error and stops rendering.

As of v1.4.13, I've added an option to suppress the error. In your main app.js file, you can use the suppress_compile_errors option:

createApp({
    render: renderSpladeApp({ el })
})
    .use(SpladePlugin, {
        "suppress_compile_errors": true
    })
    .mount(el);

Make sure to update both packages (JS + PHP).

Did you check file & directory permissions on your OS?