- 基础库版本2.20.0 + less + lazyCodeLoading导致编译出错
工具版本:1.06.2201240 macOS(ARM64) 基础库版本:2.20.0或更高 project.config.json关键配置 { "setting": { "useCompilerPlugins": ["less"], }, "libVersion": "2.22.0", } app.json关键配置 { "lazyCodeLoading": "requiredComponents", } 代码片段:https://developers.weixin.qq.com/s/cMmA0emd7Zxd 报错内容: [] {active: "", tabBar: Array(2)} VM5872 index.js:635 TypeError: Cannot read property 'push' of undefined at m0 (<anonymous>:41:4) at VM5872 index.js:631 at Vr (WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2) at r.pn.create (WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2) at Function.b.prepare (WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2) at b._advancedCreate (WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2) at Function.b.createWithGenerics (WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2) at Object.b.create [as createElement] (WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2) at WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2 at ca (WASubContext.js?t=wechat&s=1645350791277&v=2.22.0:2) index.js:9 代码片段是一种迷你、可分享的小程序或小游戏项目,可用于分享小程序和小游戏的开发经验、展示组件和 API 的使用、复现开发问题和 Bug 等。可点击以下链接查看代码片段的详细文档: index.js:3 https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/devtools.html --------------------------------------------自己找到的解决方案-------------------------------------------- useCompilerPlugins设置为false,其它不动:页面正常编译,但less文件无法加载,页面样式丢失(❌该方案不可行)libVersion设置为2.19.6或更低,其它不动:页面正常编译及运行(✅方案可行,但无法使用高版本基础库的新特性)移除lazyCodeLoading配置,其它不动:页面正常编译及运行(✅方案可行,但不知对小程序启动性能是否有影响)
2022-02-21 - 扩展 "Prettier - Code formatter" 无法格式化 "app.js"?
工具版本:微信开发者工具 Stable 1.03.2009140 操作系统:macOS Catalina 10.15.6 保存文件自动格式化时提示:扩展 "Prettier - Code formatter" 无法格式化 "app.js" [图片] 编辑器配置: { "editor.formatOnSave": true, "editor.stablePeek": true, "editor.tabCompletion": "on", "editor.tabSize": 4, "editor.wordWrapColumn": 120, "editor.minimap.enabled": true, "explorer.openEditors.visible": 0, "search.exclude": { "**/dist": true, "**/miniprogram_npm": true }, "files.watcherExclude": { "**/dist/**": true, "**/miniprogram_npm/**": true }, "files.associations": { "*.cjson": "jsonc", "*.wxs": "javascript", "*.wxss": "css" }, "[wxml]": { "editor.defaultFormatter": "qiu8310.minapp-vscode" }, "[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "minapp-vscode.wxmlFormatter": "prettyHtml", "minapp-vscode.formatMaxLineCharacters": 120, "minapp-vscode.disableAutoConfig": true, "minapp-vscode.showSuggestionOnEnter": true, "minapp-vscode.prettier": { "printWidth": 120, "semi": false, "singleQuote": true, "trailingComma": "none" }, "minapp-vscode.prettyHtml": { "printWidth": 120, "usePrettier": false, "sortAttributes": true }, "prettier.printWidth": 120, "prettier.singleQuote": true, "prettier.semi": false, "prettier.trailingComma": "none", "less.compile": { "outExt": ".wxss" } } 自定义扩展: [图片]
2020-09-17 - 为什么每次保存文件都提示“正在运行保存参与程序...:正在格式化”?版本1.03.2006091
提示截图,之前1.03.2005141版本没有问题 [图片] 编辑器设置截图 [图片] 自定义扩展,来自vscode [图片] 自定义配置参数 { "editor.formatOnSave": true, "editor.renderControlCharacters": true, "editor.stablePeek": true, "editor.tabCompletion": "on", "editor.tabSize": 2, "editor.fontSize": 12, "editor.lineHeight": 0, "editor.wordWrap": "off", "editor.minimap.enabled": false, "editor.insertSpaces": true, "editor.renderWhitespace": "all", "editor.wordWrapColumn": 120, "editor.minimap.maxColumn": 50, "editor.minimap.showSlider": "always", "[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "explorer.openEditors.visible": 0, "search.exclude": { "**/dist": true, "**/miniprogram_npm": true }, "files.watcherExclude": { "**/dist/**": true, "**/miniprogram_npm/**": true }, "files.eol": "\n", "files.trimFinalNewlines": true, "files.insertFinalNewline": true, "workbench.iconTheme": "material-icon-theme", "material-icon-theme.activeIconPack": "vue_vuex", "material-icon-theme.showWelcomeMessage": false, "javascript.format.semicolons": "remove", "javascript.preferences.quoteStyle": "single", "javascript.updateImportsOnFileMove.enabled": "always", "files.autoSave": "off", "files.associations": { "*.cjson": "jsonc", "*.wxs": "javascript", "*.wxss": "css" }, "minapp-vscode.wxmlFormatter": "prettyHtml", "minapp-vscode.formatMaxLineCharacters": 120, "minapp-vscode.disableAutoConfig": true, "minapp-vscode.showSuggestionOnEnter": true, "minapp-vscode.prettier": { "printWidth": 120, "semi": false, "singleQuote": true, "trailingComma": "none" }, "minapp-vscode.prettyHtml": { "printWidth": 120, "usePrettier": false, "sortAttributes": true }, "prettier.printWidth": 120, "prettier.singleQuote": true, "prettier.semi": false, "prettier.trailingComma": "none", "workbench.editor.enablePreview": true, "workbench.editor.enablePreviewFromQuickOpen": true, "workbench.colorTheme": "Default Dark+", "workbench.preferredLightColorTheme": "Default Light+", "window.autoDetectColorScheme": true, "explorer.confirmDelete": false, "less.compile": { "outExt": ".wxss" } }
2020-06-10