Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mix() should not throw an exception in production. #20355

Closed
adampatterson opened this issue Aug 1, 2017 · 4 comments
Closed

mix() should not throw an exception in production. #20355

adampatterson opened this issue Aug 1, 2017 · 4 comments

Comments

@adampatterson
Copy link
Contributor

  • Laravel Version: 5.4.*
  • PHP Version: 7.1

Description:

First, I know that mix() is in Laravels Foundation. But I wanted feedback here first before posting this to Laravel.

I understand the value in knowing that an asset is missing and know that it can be resolved. What I am covering here is the severity of how mix() fails.

Throwing an exception over a file that might exist but didn't get versioned is a bit drastic.

We use Docker and Docker builds our assets so it's common to make a change and not re-run Mix before committing. My site will work perfectly fine without a number of included scripts that are loaded on all pages but if you throw that exception you essentially take down the entire site.

I would like to see the exception locally but all the page to function in production while possibly being broken or malfunctioning. If it's possible to send a notification or post a message to the error handler that would let sentry pick that up then that would be even better.

The other issue at least for me is that because a 500 error is thrown I have not been able to create a custom error page for it. Worked in 5.2 but not in 5.4 so our customers don't have any recourse. Again yes, we have error logging but that's not the point.

Steps To Reproduce:

{{ mix('/static/css/base-not-versioned.css')}}

The exception is thrown.

@taylorotwell
Copy link
Member

/cc @JeffreyWay

@laurencei
Copy link
Contributor

The other issue at least for me is that because a 500 error is thrown I have not been able to create a custom error page for it.

@adampatterson - FYI this is fixed in 5.5.

You can backport the fix to 5.4 by reading this PR: #18481

@adampatterson
Copy link
Contributor Author

@laurencei I saw that! I'm excited!

@themsaid
Copy link
Member

themsaid commented Aug 4, 2017

Moving the discussion to the opened PR.

@themsaid themsaid closed this as completed Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants