inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
1.99k stars 222 forks source link

inertia returning encoded html in output for data-page #645

Closed TerrePorter closed 3 weeks ago

TerrePorter commented 3 weeks ago

I set up a inertia with vue test page in laravel. It seems the inertia is returning encoded html. I'm not sure if it is a bug or a configuration problem.

<div id="app" data-page="{&quot;component&quot;:&quot;Modules\/Admin\/resources\/views\/campaigns\/edit_categories&quot;,&quot;props&quot;:{&quot;errors&quot;:{},&quot;category_id&quot;:&quot;2&quot;},&quot;url&quot;:&quot;\/admin\/campaigns\/edit_categories_vue\/2&quot;,&quot;version&quot;:&quot;admin::layouts.master-vue-inertia51ce706c16bef881bd92ff38f4a86f8f&quot;}"></div>

this is my layout template,

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    @vite(\Nwidart\Modules\Module::getAssets())

    {{ module_vite('build-admin', 'resources/assets/js/app.js') }}
    {{ module_vite('build-admin', 'resources/assets/js/app-edit-categories.js') }}

    @inertiaHead
</head>
<body>
    @inertia
</body>
</html>

What could be causing this ?

ref: https://laracasts.com/discuss/channels/inertia/inertia-output-html-encoded

RobertBoes commented 3 weeks ago

What exactly is the issue? That output looks fine, for example the same seems to be rendered on Inertia's website; view-source:inertiajs.com

TerrePorter commented 3 weeks ago

@RobertBoes its not running the component, all i get is a blank page. I was thinking it should be a josn object.

TerrePorter commented 3 weeks ago

@RobertBoes sorry, i see because it is in a data attribute it can't be a real object because of the quotes, I will keep digging in to why i am getting a blank page. Thanks

RobertBoes commented 3 weeks ago

@TerrePorter for questions you could always reach out through GitHub Discussions, or our Inertia Discord server

TerrePorter commented 3 weeks ago

@RobertBoes Thanks, I didn't know about those. I greatly appreciate you taking the time to reply.