inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.53k stars 433 forks source link

Vue response for the page in json and not html creates some issues that prevents to generate pdf with spatie/browsershot #1598

Closed sibalonat closed 1 year ago

sibalonat commented 1 year ago

Version:

Describe the problem:

I started a project 5 months ago with inertia, considering that it would be good to actually move fast with the project. I know that in most cases inertia returns JSON and not HTML, but there are some cases, for example extracting the HTML out of the page that literally becomes impossible to accomplish. I wanted to use spatie browsershot, and in two days I haven't had the possibility to get around this issue.

Steps to reproduce:

Create a file for the pdf on the pages and try to install browsershot, dd($htmlofinertia) its json

craigrileyuk commented 1 year ago

You only get an Inertia response if you send an Inertia request.

Just use a standard href link or an axios/fetch request instead.