LeBlaireau
LeBlaireau

Reputation: 17467

Laravel Mix - unexpected token error

I am trying to run this

Vue.component(
      'async-webpack-example',
      () => import('./my-async-component')l
    )

I get this error but thought mix could compile ES2015 syntax?

Syntax Error: Unexpected token (30:8)

  28 | Vue.component(
  29 |   'async-webpack-example',
> 30 |   () => import('./my-async-component')
     |         ^
  31 | )

Upvotes: 0

Views: 721

Answers (1)

Yat23
Yat23

Reputation: 171

try add System. I think you might be using an earlier release of Webpack 2. System.import() was deprecated in favor of import() in webpack 2.1.0-beta.28.

Change System.import() to import() #2163

Vue.component(
      'async-webpack-example',
      () => System.import('./my-async-component')l
    )

Upvotes: 1

Related Questions