Coder Social home page Coder Social logo

Production mode about inertia-laravel HOT 4 CLOSED

inertiajs avatar inertiajs commented on June 20, 2024
Production mode

from inertia-laravel.

Comments (4)

cmizzi avatar cmizzi commented on June 20, 2024

I think it's related with #13, probably.

from inertia-laravel.

cmizzi avatar cmizzi commented on June 20, 2024

I have in mind this simple case, customizable by the user (modal or not, etc.).

Frame (1)

from inertia-laravel.

cmizzi avatar cmizzi commented on June 20, 2024

To do that, the user should be able to detect the error in the layout component (for example), and load an "error" component. But, the client side has to be able to detect this error.

from inertia-laravel.

reinink avatar reinink commented on June 20, 2024

Hey @cmizzi!

Are you suggesting that Inertia shouldn't show modals for errors in production? I think that's really up to the developer, and not something this adapter has to worry about.

That way I'd personally handle this is by updating my Laravel exception handler to return a proper Inertia response in the event of a server-side error. Doing that you can avoid showing the modal. I've actually tested this, and created an Error.vue page component, and it worked great. You could even do an environment check in your exception handler, and only show that page component in production.

No matter what, I think it's important that Inertia does something logical when it receives a non-Inertia response. For example, that could be caused by something entirely outside of Laravel. For example, maybe your DNS service or hosting provider shows some type of error page before it even hits your app. The modal is a great solution in those situations.

from inertia-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.