React Pacakger server - getBoolOptionFromQuery error #218
Copy link
Copy link
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
Using the starter app, the node server fails. I'd submit a fix, but can't sign the CLA right now.
TypeError: Cannot read property 'dev' of null
at getBoolOptionFromQuery (/Users/idmaffet/react-native/IanTest/node_modules/react-native/packager/react-packager/src/Server/index.js:276:12)
It's an easy fix - just modify the if statement to check if the query object exists
function getBoolOptionFromQuery(query, opt, defaultVal) {
if (!query||(query[opt] == null && defaultVal != null)) {
return defaultVal;
}
return query[opt] === 'true' || query[opt] === '1';
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Activity
amasad commentedon Mar 26, 2015
I think your node version is outdated. Can you run
node -v?But we should definitely handle that.
imaffett commentedon Mar 26, 2015
v0.11.14
amasad commentedon Mar 26, 2015
yes that version of node has a bug with parsing the url query. Here is the correct behavior http://repl.it/fdz/1
On node v0.11.14 it's null. I'll add the fix anyways. Thanks
imaffett commentedon Mar 26, 2015
Thanks for the fast response.
lvyile commentedon Mar 27, 2015
I upgraded node from v0.11.14 to v0.12.1, it works!
sosoyososo commentedon Mar 27, 2015
The same problem on v0.13.0-pre .
amasad commentedon Mar 27, 2015
fixed via 0c83766
[react-packager] Fix node v0.11.14 query parse bug