Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kenprogrammer's avatar

InertiaJS Unable to show page content

This code snippet from InertiaJS docs doesn't work. Blank page on both Vue and ReactJS. No console errors and by inspecting elements the component is mounted.

import { render } from 'react-dom'
import { createInertiaApp } from '@inertiajs/inertia-react'

createInertiaApp({
  resolve: name => require(`./Pages/${name}`),
  setup({ el, App, props }) {
    render(<App {...props} />, el)
  },
})

But the following from a blog post works for ReactJS.

import React from 'react'
import { render } from 'react-dom'

const app = document.getElementById('app')

render(
  <InertiaApp
    initialPage={JSON.parse(app.dataset.page)}
    resolveComponent={name => import(`./Pages/${name}`).then(module => module.default)}
  />,
  app
)

Anything wrong with the official code snippet ?

0 likes
7 replies
Sinnbeck's avatar

Are you using laravel mix 6? Version 5 has a few issues

Please or to participate in this conversation.