CRNA,genymotion,博览会怪异错误 [英] CRNA, genymotion, expo weird error

查看:92
本文介绍了CRNA,genymotion,博览会怪异错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用genymotion运行我的React Native开发环境.加载特定组件时,我收到console.error消息:there was a problem sending log messages to your development environment,它具有一个奇怪的堆栈跟踪,该跟踪使用<unknown>代替了几个命名函数.

I am using genymotion to run my React Native dev environment. When a specific component loads, I get the console.error message: there was a problem sending log messages to your development environment with a weird stack trace that uses <unknown> in place of several named functions.

我将问题缩小为代码中的一个组件:

I narrowed the problem down to just one component in my code:

class Questions extends React.Component {
  constructor(props){
    super(props);
    this.state = {
                  style: 'all',
                  selected: ''}
  }
  render = () => {
    return (
      <View style={styles.questions}>
        <ScrollView>
          {(this.props.questions && this.state.style == 'all')&&
            this.props.questions.map(post => {
              return (
                <TouchableHighlight onPress={() => this.loadQuestion(post)} key={post.ID + new Date(post.post_date)} style={styles.questionCard} >
                  <View style={styles.questionCard} >
                    <View style={styles.title}>
                      <Text style={{color: 'white'}}>{post.post_title}</Text>
                      <Text style={{color: 'white'}}> - {post.display_name} {utils.timeSince(new Date(post.post_date))}</Text>
                    </View>
                  </View>
                </TouchableHighlight>
              )
            })
          }
        </ScrollView>
      </View>
    )
  }
}

无论何时加载此组件,我都会收到上面提到的console.error.我知道这没什么大不了的,我什至都不希望得到答案,但是我很茫然.

Whenever this component loads, I got the console.error mentioned above. I know this isn't much to go on and I don't really even expect an answer, but I'm at a loss.

如果您搜索该确切的错误消息,则会在Github上找到一个没有解决方法的问题,并指出这可能是expo sdk中的一个错误(这很有意义),并链接了另一个404s问题.

If you google that exact error message you will find one issue on Github with no resolution, mentioning that it may be an error in the expo sdk (which makes sense) and linking another issue that 404s.

推荐答案

好的,我想我已经解决了,问题实际上出在我的utils函数timeSince中.我有一个混乱的console.log()语句,当我删除它时,错误消失了.显然,使用此配置,您无法从内部资产调用console.log().

Okay I think I solved it, the problem was actually in my utils function timeSince. I had a stray console.log() statement and when I removed it the error went away. Apparently with this configuration you cannot call console.log() from internal assets.

好的,因此,在进一步调试之后,当您尝试console.log()一个对象时,将引发此错误,而日志的起源无关紧要.

Okay so after some further debugging, this error is thrown when you try to console.log() an object, it doesn't matter where the log originates.

这篇关于CRNA,genymotion,博览会怪异错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆