-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序转换 taro 后 yarn dev:weapp 大量报错组件编译失败 #2920
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
后续的大部分错误是 |
这是其中一段报错: 错误 组件编译 组件src/components/overdue-list/overdue-list.js编译失败!
{ Error: ENOENT: no such file or directory, open 'H:\test\wxapp\miniprogram\taroConvert\static\iview\progress\index'
at Object.openSync (fs.js:438:3)
at Object.readFileSync (fs.js:343:35)
at buildSingleComponent (C:\Users\lp\AppData\Local\Yarn\Data\global\node_modules\@tarojs\cli\src\weapp.js:1746:31)
at Promise.all.componentPathList.map.componentObj (C:\Users\lp\AppData\Local\Yarn\Data\global\node_modules\@tarojs\cli\src\weapp.js:1679:60)
at Array.map (<anonymous>)
at buildDepComponents (C:\Users\lp\AppData\Local\Yarn\Data\global\node_modules\@tarojs\cli\src\weapp.js:1679:40)
at buildSingleComponent (C:\Users\lp\AppData\Local\Yarn\Data\global\node_modules\@tarojs\cli\src\weapp.js:1845:40)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path:
'H:\\test\\wxapp\\miniprogram\\taroConvert\\static\\iview\\progress\\index' } overdue-list 当中找不到原因也没有语法提示 —— 下面是转换后的 overdue-list 代码 感谢大佬的解答 import { View, Text } from '@tarojs/components'
import Taro from '@tarojs/taro'
import withWeapp from '@tarojs/with-weapp'
import Iprogress from '../../../static/iview/progress/index'
import './overdue-list.scss'
withWeapp('Component')
class _C extends Taro.Component {
static defaultProps = {
item: null
}
_observeProps = []
state = {}
lifetimes = {
attached: function() {},
detached: function() {
// 在组件实例被从页面节点树移除时执行
}
}
config = {
component: true
}
render() {
const { item: item } = this.props
const {} = this.state
return (
<View className='sale-list'>
<View className='ranking'>
<Text
className={
'ranking-num ' +
(item.ranking > 3
? 'normal-color'
: item.ranking == 1
? 'number-one'
: item.ranking == 2
? 'number-two'
: 'number-three')
}
>
{item.ranking}
</Text>
<View className='title-wrap'>
<Text className='time'>{item.name}</Text>
<Text className='iconfont icon-dayuhao' />
</View>
</View>
<View className='content'>
<View className='content-list'>
<View className='sale-data'>
<View className='item'>
{'总应收: ' + item.allReceive + ' 元'}
</View>
<View className='item'>
逾期占比:
<Iprogress
iClass='progress'
percent={item.proportion}
status='success'
/>
</View>
</View>
<View className='sale-data'>
<View className='item'>
{'正常应收: ' + item.normalReceive + ' 元'}
</View>
<View className='item'>
{'逾期应收: ' + item.overdueReceive + ' 元'}
</View>
</View>
</View>
</View>
</View>
)
}
}
export default _C 下面是·index.js·这个文件内容 Component({
externalClasses: ['i-class'],
properties: {
percent: {
type: Number,
value: 0
},
// normal || active || wrong || success
status: {
type: String,
value: 'normal'
},
strokeWidth: {
type: Number,
value: 10
},
hideInfo: {
type: Boolean,
value: false
}
}
}); 摸不着头脑是什么原因,有什么调试方法吗? |
报错说这个文件不存在 |
问题描述
dev 报错如下: 错误信息较多,请问是某些组件不能平滑过渡的问题吗?
原项目中引用了某些静态资源
复现步骤
[或者可以直接贴源代码,能贴文字就不要截图]
期望行为
[这里请用简洁清晰的语言描述你期望的行为]
报错信息
[这里请贴上你的完整报错截图或文字]
系统信息
Taro CLI 1.2.26 environment info:
System:
OS: Windows 7
Binaries:
Node: 10.15.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.15.2 - C:\Users\lp\AppData\Roaming\npm\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
补充信息
如果转换排错成本过高,是否继续用原生小程序维护 较为方便?
The text was updated successfully, but these errors were encountered: