You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ 页面 pages/my/myIndex 预渲染失败:
TypeError: str.charAt is not a function
at unquote (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:24:21)
at getAttrValue (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:36:12)
at /Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:73:36
at Array.map (<anonymous>)
at Prerender.buildAttributes (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:73:18)
at Prerender.renderToXML (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:93:111)
at Object.base.apply (/Users/zhaoyang/Projects/preplan-taro/node_modules/vm2/lib/contextify.js:620:32)
at Array.map (<anonymous>)
at Object.base.apply (/Users/zhaoyang/Projects/preplan-taro/node_modules/vm2/lib/contextify.js:228:34)
at Prerender.renderToXML (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:93:146)
at Prerender.<anonymous> (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:161:28)
at Generator.next (<anonymous>)
at fulfilled (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:5:58)
2.问题2
⚠️ 页面 pages/home/homeIndex.config 预渲染失败:
TypeError [Error]: page.onLoad is not a function
at module.exports (/Users/zhaoyang/Projects/preplan-taro/dist:5:16)
at Object.base.apply (/Users/zhaoyang/Projects/preplan-taro/node_modules/vm2/lib/contextify.js:228:34)
at /Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:198:13
at new Promise (<anonymous>)
at Prerender.renderToData (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:190:16)
at Prerender.<anonymous> (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:157:35)
at Generator.next (<anonymous>)
at /Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/zhaoyang/Projects/preplan-taro/node_modules/@tarojs/mini-runner/dist/prerender/prerender.js:4:12)
问题描述
1.组件的属性值处理有问题,现在只处理string类型,number boolean都会导致报错
https://github.com/NervJS/taro/blob/next/packages/taro-mini-runner/src/prerender/prerender.ts#L28
getAttrValue的参数,boolean和number都有可能
2.不应该处理*.config.ts文件
复现步骤
1.随便写number boolean类型的值都会编译报错(下面属性值随便取的,三种情况任一种都会报错)
2.按照下面配置,如果对应的文件夹里面有*.config.ts文件,也会编译并报错
prerender: {
match: 'pages/home/**'
}
期望行为
运行正常
报错信息
1.问题1
2.问题2
系统信息
补充信息
能不能
static getDerivedStateFromProps()
给了例子,或者给个完整的prerender的demo另外,这种错误时因为什么导致的?
The text was updated successfully, but these errors were encountered: