網站首頁 編程語言 正文
Module parse failed: Unexpected token (3:27) File was processed with these loaders: * ./node_module
作者:py_boy 更新時間: 2022-03-03 編程語言Module parse failed: Unexpected token (10:27)
File was processed with these loaders:
* ./node_modules/vue-loader-v16/dist/templateLoader.js
* ./node_modules/cache-loader/dist/cjs.js
* ./node_modules/vue-loader-v16/dist/index.js
You may need an additional loader to handle the result of these loaders.
vue2.*
該錯誤解決辦法如下
vue.config.js
{
// ***********
configureWebpack: {
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
},
],
}
],
},
}
// **************
}
接下來可能報這個錯誤
Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
看下vue版本和@vue/compiler-sfc版本,記得保持一致,還有一個vue-loader下載最新的
npm i @vue/compiler-sfc@latest
npm i vue-loader@next
vue3.*
如果你使用的是vue3.0
就不要添加vue-loader,因為vue3.0有自己的loader
造成這個的原因是添加了lang=‘ts’,你需要添加typescript和ts-loader,然后在webpack中添加
在這里插入代碼片
{
test: /\.ts$/,
loader: 'ts-loader',
options: { appendTsSuffixTo: [/\.vue$/] }
}
vue3.*添加vue-loader
vue3.*擁有自己的loader,vue-loader處理帶有setup的vue3組件會爆出下面錯誤
“Component is missing template or render function.”
你把import的組件輸出出來會發現啥都沒有
原文鏈接:https://blog.csdn.net/py_boy/article/details/121576673
相關推薦
- 2022-04-12 npm ERR! missing script: dev
- 2022-12-28 C++關鍵字const使用方法詳解_C 語言
- 2022-08-20 Oracle刪除歸檔日志及添加定時任務_oracle
- 2022-05-22 Nginx服務LNMP之WordPress部署流程步驟_nginx
- 2023-02-17 pytorch/transformers?最后一層不加激活函數的原因分析_python
- 2022-07-17 SQL?Server中的事務介紹_MsSql
- 2022-06-01 基于Android實現可滾動的環形菜單效果_Android
- 2022-03-16 VS2022?安裝.NET4.5目標包的方法_實用技巧
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支