網(wǎng)站首頁 編程語言 正文
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的組件輸出出來會發(fā)現(xiàn)啥都沒有
原文鏈接:https://blog.csdn.net/py_boy/article/details/121576673
相關推薦
- 2024-02-01 mybatis plus 分頁查詢出現(xiàn)count()
- 2022-09-23 Golang分布式應用之Redis示例詳解_Golang
- 2022-09-03 C#中DataSet、DataTable、DataRow數(shù)據(jù)的復制方法_C#教程
- 2022-05-17 ubuntu E: 無法獲得鎖 /var/lib/dpkg/lock-frontend - open
- 2022-08-18 Linux阿里云服務器中安裝Nginx命令的詳細過程_服務器其它
- 2022-04-25 ASP.NET?Core中Razor頁面的Handlers處理方法詳解_基礎應用
- 2022-12-29 解決React報錯Property?value?does?not?exist?on?type?HTM
- 2022-08-23 iOS底層探索之自動釋放池原理解析_IOS
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細win安裝深度學習環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結構-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支