If an error occurs during async content loading, the error message looks like:
Unexpected error while loading more content:', { line: 81832, column: 47, sourceURL: 'http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }
Such messages are incredibly unhelpful, given that the internal error message is swallowed and the line number is messed up internally by react-native.
The problem is caused by this line:
console.error('Unexpected error while loading more content:', error);
Here, only the content of error will be serialized by console.error, ignoring the prototype chain and thus the value of error.message (defined in Error).
A simple workaround would be to change this line by something like:
console.error('Unexpected error while loading more content:', error.toString(), error);
This is a very small change but it makes the debugging simpler.