当前位置:网站首页>VSCode打开小程序运行到微信开发者工具WXML 文件编译报错
VSCode打开小程序运行到微信开发者工具WXML 文件编译报错
2022-04-22 06:10:00 【sunshine641】
原生小程序项目,用VScode打开,再运行到微信开发者工具,一直在报错
内容大概是:[ WXML 文件编译错误] ./.history/pages/……
全是说history这个文件夹下的内容报错
原因:
使用vscode开发的时候,如果安装了local history,编辑代码中会自动产生history文件,其中也会包含一些为完成,或者出错的代码。
微信开发者工具开发小程序的时候,会去读取这个文件夹,就会检测到历史文件中的错误,然后在控制台中输出这些错误
解决办法
在项目根目录下创建.vscode文件夹,并在文件夹内创建settings.json,然后再其中写如下配置。
1/2不会生成history文件。3会
//1、直接关闭该项目的local history
{
"local-history.enabled": 0
},
//2、设置exclude,将开发目录排除出去,
{
"local-history.exclude": [
"**/pages/**",
"**/utils/**",
"**/app**",
"**/app.json/**",
"**/.history/**",
"**/.vscode/**",
"**/node_modules/**",
"**/typings/**",
"**/out/**",
"**/Code/User/**"
]
}
// 3、设置history的保存路径,把文件夹设置在项目文件夹之外
{
"local-history.path": "E:\\wxapp\\history",
}
记录查到的其他错误,预防以后遇到:
1:微信小程序开发工具的bug,右键创建一个目录并创建页面时,开发工具会自动帮我们在app.json文件中pages下创建一个路径配置,自动生成的路径多了一个“/”2:
再就是代码编写的小错误,比如中英文切换、标间没有闭合、空格回车、缺少逗号分号等问题。
版权声明
本文为[sunshine641]所创,转载请带上原文链接,感谢
https://blog.csdn.net/sunshine641/article/details/124297315
边栏推荐
- 老程序员常逛的网站(持续更新)
- Is digital IC design promising? How about career development and salary?
- Introduction to IC Analog Layout - learning notes on layout Basics (4)
- Quantify PM2 in 5 cities 5 changes over time
- pyautocad 选择对象报错的解决方案
- 集成电路模拟版图入门-版图基础学习笔记(五)
- Chip design how to prepare for the upcoming autumn recruitment and spring recruitment in the coming year?
- .NET学习笔记(二)----无处不在的反射(包含读取json的方法)
- 软件测试流程
- common-net hp unix系统 ftp服务器 listFiles 返回为空解决方案。
猜你喜欢

Nacos cluster configuration

Mcs-5 interrupt technology (Theory)

Goodbye, postman. One thing to say: apifox is yyds

阿里云部署RSSHub踩坑笔记

Matlab GUI zoom - some controls zoom, some controls do not zoom - Design Tutorial

数字ic设计有前途吗?职业发展,薪资待遇如何?

Lcfnet series can to optical fiber Ethernet equipment realizes ultra long-distance optical fiber communication between can networks

Parseexception unparseable date time conversion exception

分布式任务调度与计算框架:PowerJob 快速开始(本地IDE版) 02

C daily development notes -- solve the problem that one set references another set, resulting in changes together
随机推荐
Nacos集群架构
Introduction to IC Analog Layout - learning notes on layout Basics (4)
Experiment 4 cycle program design
leetcode 打卡
数字IC设计自学入门难吗?如何快速入门呢?
RT thread transplantation BSP driven UART
从FAB厂转到IC验证的心酸历程
STM32 timer synchronization trigger code experimental verification and sharing
阿里云部署Tiny Tiny RSS踩坑笔记
[review of Blue Bridge Cup] tree of life
leetcode268:丢失的数字
Sad process from Fab factory to IC Verification
MATLAB:去除音频信号噪音
数字IC设计和CS选那个?
Nacos持久化切换配置
leetcode 617 合并二叉树
Oracle JDK vs OpenJDK
pyautocad 选择对象报错的解决方案
Dcoker installation
SQL题目练习总结