首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >你好,我使用了laravel & Vue js,我的作者,我的项目,工作良好,但这个错误?

你好,我使用了laravel & Vue js,我的作者,我的项目,工作良好,但这个错误?
EN

Stack Overflow用户
提问于 2020-10-01 19:05:59
回答 1查看 3.2K关注 0票数 2
代码语言:javascript
复制
  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 :// webpack . js .org/concepts#loaders
  > <template>
  |     <div class="container">
  |         <div class="row justify-content-center">
   @ ./resources/js/Router.js 4:0-53 11:15-19
   @ ./resources/js/app.js
   @ multi ./resources/js/App.js ./resources/sass/app.scss

在APP要求中(‘./bootstrap’);

代码语言:javascript
复制
window.Vue = require('vue');
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import router from './Router'
 new Vue({
    el: '#app',
    router
});

在路由器js中

我导入vue -路由器和vue

从' Vue‘导入VueRouter,从’vue-路由器‘Vue.use(VueRouter)导入vue

从'./components/ExampleComponent.Vue‘Vue.use(VueRouter)导入用户;const路由器=新的VueRouter({模式:’历史‘,路由:{ path:'/ User ',组件: User,},{path:’/类别‘,组件:类别,} })

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-24 13:33:13

我也遇到了这个错误。在我自己的例子中,我遇到了这个错误,因为我想使用顺风2.0。

我认为这与LaravelMixV6.0或POSTCSS8有关。因为Vue SFCs还没有使用POSTCSS 8的插件。取自(https://github.com/JeffreyWay/laravel-mix/issues/2625)。

因此,在我自己的例子中,我所采取的步骤如下。

我卸载了相关的软件包-- npm uninstall tailwindcss postcss autoprefixer

  • Then --我用兼容性构建npm install tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

重新安装了它们

检查https://tailwindcss.com/docs/installation#post-css-7-compatibility-build

  1. I在package.json文件中添加了"laravel-mix": "^5.0.1",将laravel的混合度从v6.0降至V5.0.1。

npm install

最后,npm run watch

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64161764

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档