Module build failed: SyntaxError When i try for asyncComponent in Laravel + React

189 views Asked by At

I want to implement asyncComponent in laravel + react. Everything work Good before i tried asyncComponent.

When i try that return error :

Code :

import asyncComponent from '../component/asyncComponent';

const Home = asyncComponent(() => import('../pages/home') //line 9
  .then(module => module.default), { name: 'Home' });

Error:

Module build failed: SyntaxError: E:/xampp/htdocs/react/lara-react/blog-new/resources/js/back-end/layout/main.js: Unexpected token (9:34)

How to implement asyncComponent in laravel ?

0

There are 0 answers