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

eggplantSword's avatar

All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.

How can I return normal data to my Vue component?

  methods: {
    refresh() {
      this.$inertia.get('/tenants/table_data', {
         onSuccess: page => { this.tenants = page.props.tableData},
      });
    },
  },
mounted() {
    this.refresh();
  },
    public function tableData(Request $request) {
        return response()->json(['tableData' => Tenant::all()]);
    }
0 likes
3 replies
mabdullahsari's avatar

If you want to fetch partial data in your page, use axios instead.

2 likes
tykus's avatar

Use Fetch API or axios directly.

2 likes
Sinnbeck's avatar

Sounds like you just want to refresh the data already gotten using inertia?

this.$inertia.reload({
    only: ['tableData'] 
} )
3 likes

Please or to participate in this conversation.