Skip to content

Display errors if the bundle cannot be loaded #10

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

Merged
merged 11 commits into from
Dec 5, 2018
Merged

Conversation

igmoweb
Copy link
Contributor

@igmoweb igmoweb commented Nov 29, 2017

This is a bit crazy idea but I created a script that will display an error in case the bundles are not found or cannot be loaded. I believe that falling back into production bundles if the dev ones aren't found is not a good idea as it could confuse developers. This will display an error with some details.

captura de pantalla 2017-11-29 a las 10 25 21

@igmoweb igmoweb changed the base branch from fix/wrong-dev-manifest-loading to master November 29, 2017 16:04
Copy link
Collaborator

@kadamwhite kadamwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes some sense to me but I'd like to get input from @rmccue before we move forward.

@rmccue
Copy link
Member

rmccue commented Nov 1, 2018

Looks alright to me.

Where are the styles for this error taken from? Could we copy CRA's error styling instead? (You can use react-wp-ssr's exception handler and CSS as an easy way to grab that.)

@igmoweb
Copy link
Contributor Author

igmoweb commented Dec 5, 2018

@kadamwhite @rmccue I've updated the PR:

  • It now handles the error from PHP, no external JS/CSS is needed to be loaded
  • Execution stops when the error appears (this will prevent any other style/JS from the theme to be loaded that could change the aspect of the error).

Here's a sample:

captura de pantalla 2018-12-05 a las 13 23 26

Copy link
Member

@rmccue rmccue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, if we're going to have monospaced text, we should keep the content plain text. I'd drop the ULs here in favour of just straight up text, or show the error differently.

@igmoweb
Copy link
Contributor Author

igmoweb commented Dec 5, 2018

@rmccue Thanks, should be solved now.

Copy link
Member

@rmccue rmccue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😗 👌

@rmccue rmccue merged commit aad6484 into master Dec 5, 2018
@rmccue rmccue deleted the new/display-errors branch December 5, 2018 15:39
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

Successfully merging this pull request may close these issues.

3 participants