Skip to content

react-native: No bundle url present #5

@timi-black

Description

@timi-black

错误详情

No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.

RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
start

解决步骤

  • 添加host 127.0.0.1 localhost,这是由于mac的localhost并不是指向127.0.0.1,可以使用nslookup localhost查看详情
Server:         192.168.1.1
Address:        192.168.1.1#53

因此当启动时就找不到对应的地址:

URL: http://192.168.1.1:8081/index.bundle?platform=ios&dev=true&minify=false

  • 删除/ios/build

  • react-native run-ios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions