Skip to content

[Packager] Print a more helpful error message when loading a path that can't be handled #1944

@ide

Description

@ide

Currently if you load a bundle that the packager doesn't support (for example if there's a typo in the URL path) you get this stack trace:

TypeError: Path must be a string. Received null
    at assertPath (path.js:8:11)
    at Object.posix.resolve (path.js:413:5)
    at react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js:153:33
    at tryCallOne (react-native/node_modules/promise/lib/core.js:37:12)
    at react-native/node_modules/promise/lib/core.js:103:15
    at flush (react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:408:9)
    at process._tickCallback (node.js:337:13)

But it would be much less cryptic to get something like "Could not find source file at path/to/SomeApp.js". Anyone from the community want to help work on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions