1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Module parse failed: Unexpected token のエラー

Last updated at Posted at 2021-07-06

バージョン

laravel 8
Vue.js 2.6

内容

$ npm run watch

でエラーが出る

ERROR in ./resources/js/pages/Login.vue 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <template>
|   <h1>Login</h1>
| </template>

解決方法

webpack.mix.jsに
.vue()
を付け足すことで解決

webpack.mix.js
mix.js('resources/js/app.js', 'public/js').vue()
    .postCss('resources/css/app.css', 'public/css', [
        //
    ]);
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?