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

Error Page is not rendering CSS. #35

Closed
whobutsb opened this issue Feb 10, 2022 · 21 comments
Closed

Error Page is not rendering CSS. #35

whobutsb opened this issue Feb 10, 2022 · 21 comments

Comments

@whobutsb
Copy link

Hello there! I just updated a Laravel 8 application to Laravel 9. In my composer.json I updated:
"facade/ignition": "^2.5" to "spatie/laravel-ignition": "^1.0"

I then ran composer update. In a sample route file: I manually threw an exception with throw new \Exception('testing').
The error page that get rendered shows the content but the CSS is not being loaded. I have included a image at the bottom.
Is there something I'm missing or an additional composer command I need to run?

Thank you for the assistance.

Screen Shot 2022-02-10 at 8 04 27 AM

@whobutsb
Copy link
Author

Please ignore this issue I was able to throw another exception and the beautiful error pages are now showing up as expected.

@spartyboy
Copy link

same happening to me and its unfixable

@whobutsb
Copy link
Author

Yeah this is happening for me. It seems to show a non-styled Symfony error on view pages, but in a controller or in a route it shows the ignition error page.

@whobutsb whobutsb reopened this Feb 11, 2022
@whobutsb
Copy link
Author

same happening to me and its unfixable

Are you using Clockwork, in you app as well? https://github.com/itsgoingd/clockwork

@spartyboy
Copy link

No am using laravel debugbar

@spartyboy
Copy link

I feel its an issue the previous ignition works well with no glitch

@evtukhov
Copy link

evtukhov commented Feb 12, 2022

Screen Shot 2022-02-13 at 01 25 33

Screen Shot 2022-02-13 at 03 15 18

Screen Shot 2022-02-13 at 01 36 04

The same on Mac OS X in Chrome latest version. spatie/laravel-ignition: 1.0.4

@jez500
Copy link

jez500 commented Feb 18, 2022

I'm getting the same thing, I have clockwork installed but uninstalled it and the same thing occurs. Seems to only be with 500 errors as something less significant like an undefined variable shows ignition.

Did a bit of debugging but unsure of expected behaviour. eg should ignition disable symfony/error-handler as they appear to do the same thing? Looks like symfony error-handler is getting in beforehand causing its output to get dumped in the script tag

Started happening after upgrade from laravel 8 to 9 and changing facade/iginition to spatie/laravel-ignition. Tested versions 1.0.4 and 1.0.6

When it's working it looks top-notch! :)

@goaround
Copy link

Check if you really run PHP 8.1. That was my mistake.

@jez500
Copy link

jez500 commented Feb 18, 2022

Yeah, 8.1.1

$ php --version
PHP 8.1.1 (cli) (built: Dec 18 2021 02:01:00) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.1, Copyright (c), by Zend Technologies

@freekmurze
Copy link
Member

@jez500 have you check the version of PHP you're using for web requests? http://freek.dev/php-version

@jez500
Copy link

jez500 commented Feb 19, 2022

Hi @freekmurze, I just doublechecked with phpinfo and definitely 8.1.1. I am using php:8.1.1-fpm-alpine3.15 image

Requires from my composer.json if it helps:

    "require": {
        "php": "^8.1",
        "ext-exif": "*",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "inertiajs/inertia-laravel": "^0.5.2",
        "jeroen-g/explorer": "dev-master",
        "laravel/framework": "^9.0",
        "laravel/jetstream": "^2.6",
        "laravel/sanctum": "^2.11",
        "laravel/scout": "^9.4",
        "laravel/tinker": "^2.5",
        "multicaret/laravel-acquaintances": "^3.5",
        "pusher/pusher-php-server": "^7.0",
        "spatie/laravel-activitylog": "^4.4",
        "spatie/laravel-medialibrary": "^10.0",
        "spatie/laravel-permission": "^5.5",
        "spatie/laravel-sluggable": "^3.3",
        "stevebauman/location": "^6.3",
        "tightenco/ziggy": "^1.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "itsgoingd/clockwork": "^5.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10"
    },

@grantholle
Copy link

For me, the html is malformed:

<!DOCTYPE html>
<html lang="en" class="auto">
<!--
[stacktrace was here]
-->
<head>
    <!-- Hide dumps asap -->
    <style>
        pre.sf-dump {
            display: none !important;
        }
    </style>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="robots" content="noindex, nofollow">

    <title>Undefined property: App\Models\UserGame::$score</title>

</head>
<body class="scrollbar-lg">

<script>
    window.data = <!-- Undefined property: App\Models\UserGame::$score (500 Internal Server Error) -->
<!DOCTYPE html>
<html lang="en">

@spartyboy
Copy link

For me, the html is malformed:

<!DOCTYPE html>
<html lang="en" class="auto">
<!--
[stacktrace was here]
-->
<head>
    <!-- Hide dumps asap -->
    <style>
        pre.sf-dump {
            display: none !important;
        }
    </style>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="robots" content="noindex, nofollow">

    <title>Undefined property: App\Models\UserGame::$score</title>

</head>
<body class="scrollbar-lg">

<script>
    window.data = <!-- Undefined property: App\Models\UserGame::$score (500 Internal Server Error) -->
<!DOCTYPE html>
<html lang="en">

This exactly is what i feel is the cause it opens a new html tag in a previously opened one

@freekmurze
Copy link
Member

In the exceptions that I throw, the HTML of the Ignition page is valid.

Could you create a minimal Laravel app where you recreate the issue?

@grantholle
Copy link

I wish I could. I've upgraded two projects to Laravel 9. One (with the most dependencies and complexity) is rendering fine, the other (much simpler) will not render.

When starting a new project with the same composer.json file, it works as expected. I'm going to keep tinkering, but I really can't pinpoint what's the deal.

@grantholle
Copy link

Just doing some searching around, I think @jez500 was on to it:

Did a bit of debugging but unsure of expected behaviour. eg should ignition disable symfony/error-handler as they appear to do the same thing? Looks like symfony error-handler is getting in beforehand causing its output to get dumped in the script tag

It looks like Symfony's error handler HTML page is getting included in the output here.

@moisish
Copy link

moisish commented Feb 25, 2022

I think I found where the Symfony's error html page is included

spatie/ignition#48 (comment)

@AlexVanderbist
Copy link
Member

Hey all, a fix has been tagged here. Running composer update on your projects will automatically pull this in. Please let me know if this fixes your issues :)

@whobutsb
Copy link
Author

Amazing, thank you so much for fixing this. Just checked out a random variable in my blade template and it is now showing the correct error page.

@jez500
Copy link

jez500 commented Feb 25, 2022

Awesome, thank you!

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

9 participants