我有一个全新的 Laravel 安装。使用编译文件时npm run dev VUE出现文件错误
“您可能需要一个合适的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件”
Laravel 版本:“^8.12”
包.json
"devDependencies": {
"axios": "^0.21",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"vue": "^2.5.17",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.10"
}
Run Code Online (Sandbox Code Playgroud)
刀片文件
<div id="app">
<hello></hello>
</div>
<script src="{{mix('js/app.js')}}"></script>
Run Code Online (Sandbox Code Playgroud)
应用程序.js
require('./bootstrap');
import Vue from 'vue'
Vue.component('hello', require('./hello.vue').default);
const app = new Vue({
el: '#app'
});
Run Code Online (Sandbox Code Playgroud)
你好.vue
<template>
<div>
Hello World!
</div>
</template>
<script>
export default {
}
</script>
Run Code Online (Sandbox Code Playgroud)
npm 运行开发
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 Laravel 项目的前端从 vue 2 升级到 Vue 3。在此过程中,我遇到了一个问题
未捕获的类型错误:Vue.use 不是函数
我不知道问题出在哪里,如果您有任何想法,请帮助我。谢谢。
我正在尝试在 laravel 上安装 vue。我相信我明白了,但是当我运行 npm run watch 或 npm run dev 时,它会生成此错误。我尝试了几件事但无法解决
Error: [VueLoaderPlugin Error] vue-loader 15 currently does not support vue rules with oneOf.
at VueLoaderPlugin.apply (C:\laravel\construtora2\node_modules\vue-loader\lib\plugin-webpack4.js:46:13)
at webpack (C:\laravel\construtora2\node_modules\webpack\lib\webpack.js:51:13)
at processOptions (C:\laravel\construtora2\node_modules\webpack-cli\bin\cli.js:272:16)
at C:\laravel\construtora2\node_modules\webpack-cli\bin\cli.js:364:3
at Object.parse (C:\laravel\construtora2\node_modules\webpack-cli\node_modules\yargs\yargs.js:576:18)
at C:\laravel\construtora2\node_modules\webpack-cli\bin\cli.js:49:8
at Object.<anonymous> (C:\laravel\construtora2\node_modules\webpack-cli\bin\cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\laravel\construtora2\node_modules\webpack\bin\webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as …Run Code Online (Sandbox Code Playgroud)