create-react-app: UnhandledPromiseRejectionWarning on Node 7.7.2
Description
Bug
Expected behavior
npm start
should not return a UnhandledPromiseRejectionWarning
Actual behavior
cschroeter@pc:~/workspace/my-first-react-app$ npm start
> test@0.1.0 start /home/cschroeter/workspace/my-first-react-app
> react-scripts start
(node:1863) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: "listener" argument must be a function
(node:1863) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected):
cschroeter@pc:~/workspace/my-first-react-app$ npm ls react-scripts
my-frist-react-app@0.1.0 /home/cschroeter/workspace/my-frist-react-app
└── react-scripts@0.9.4
node -v
:
v7.7.2
npm -v
:
4.3.0
Then, specify:
- Operating system: Windows 10 in Linux Bash Shell Build 15048 (Creator Update)
To Reproduce
$ create-react-app my-first-react-app
$ cd my-first-react-app
$ npm start
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 34
- Comments: 33 (20 by maintainers)
Commits related to this issue
- Run CI on Node 7; Bump detect-port: 1.0.1 -> 1.1.0 (#1776) (#1783) * Run CI on Node 7 * Bump detect-port: 1.0.1 -> 1.1.0 * Run AppVeyor CI on Node 7 — committed to facebook/create-react-app by ryanwalters 7 years ago
- Run CI on Node 7; Bump detect-port: 1.0.1 -> 1.1.0 (#1776) (#1783) * Run CI on Node 7 * Bump detect-port: 1.0.1 -> 1.1.0 * Run AppVeyor CI on Node 7 — committed to facebook/create-react-app by ryanwalters 7 years ago
- Update react-scripts to 0.9.5 Resolves issue running this repo on Node 7.7.2. More info: https://github.com/facebookincubator/create-react-app/issues/1776 — committed to scottdixon-zz/react-router-firebase-auth by scottdixon 7 years ago
- Run CI on Node 7; Bump detect-port: 1.0.1 -> 1.1.0 (#1776) (#1783) * Run CI on Node 7 * Bump detect-port: 1.0.1 -> 1.1.0 * Run AppVeyor CI on Node 7 — committed to sbuzonas/react-scripts by ryanwalters 7 years ago
- Run CI on Node 7; Bump detect-port: 1.0.1 -> 1.1.0 (#1776) (#1783) * Run CI on Node 7 * Bump detect-port: 1.0.1 -> 1.1.0 * Run AppVeyor CI on Node 7 — committed to CodingZeal/create-react-app by ryanwalters 7 years ago
- Merge upstream changes from create-react-app 0.9.x (#84) * Heroku Deployment: Adds a note on how to resolve "File/Module Not Found Errors" (#1260) * Adds note on how to resolve file or directory ... — committed to trunkclub/tcweb-build by iamlacroix 7 years ago
- [chore]: upgrade react-scripts to latest Fixes https://github.com/facebookincubator/create-react-app/issues/1776 — committed to amira-s/react-exam by amira-s 7 years ago
- Merge upstream create-react-app v1.0.7 (#90) * Bust AppVeoyr cache * Relax ESLint config peerDependency (#1740) * Fix internal linting setup and add missing headers (#1741) * Fix eject for l... — committed to trunkclub/tcweb-build by iamlacroix 7 years ago
说中文撒大佬们
(We definitely should support Node 7 tho)
0.9.5 is out with the fix. https://github.com/facebookincubator/create-react-app/releases/tag/v0.9.5
This problem seems to be caused by
detect-port:1.0.1
, used by react-scripts. It causes an error indetect-port/lib/detect-port.js
on line 61socket.connect(...)
.detect-port
is currently at version 1.1.0 which features a different approach of port detection. This version resolves the error for node v7.7.2, and also works with 7.6.0 and 7.7.1.The Travis build test of version 1.1.0 of
detect-port
seems to fail, because the test is using node v4.8.0. On node 7.6.0, 7.7.1 and 7.7.2 the tests complete without any problems.As the minimum node version of
react-scripts
is>=4
I am not sure if upgrading the version ofdetect-port
inpackage.json
inreact-scripts
is an acceptable solution asdetect-ports:1.1.0
only passes its test on node version>=6
.We should probably run all test cases on Node 7 then. 🤷♀️
Node 8 comes out in a month though, which I assume means we would drop Node 7 support. Worth waiting?
Can reproduce in Linux Mint 18.1 with the same node/npm versions.
Problem can be resolved by downgrading node to 7.7.1 or older. The problem appeared after upgrading node to 7.7.2.
Try deleting
node_modules
and running install again. Also make sure youryarn.lock
doesn’t have the old version somehow.For any newbies running into this bug, I fixed it by downgrading NPM to the LTS (latest stable version) of 6.11.2.
It can be bug of Node 7.7.2 and if it is, it should be fixed by https://github.com/nodejs/node/pull/11762
+i think that promise should be
catch
somewhereI wanna state that for me this isn’t a blocking problem, just a pesky one 😃
I don’t think we should skip supported versions, it would be confusing.
Ah, brilliant @vhain! This definitely looks like a regression then. 😄