Closed jdreskell closed 1 year ago
The problem comes from this app using the nullish coalescing operator ??
and sister optional chaining operator ?.
that provide a very nice way to deal with undefined
, null
and default values. It was implemented in Node 14 and switching to that would be the quick fix. You can find more at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing including node and browser compatibility versions.
Your hard coded port number solves the first error. The second error in the if statement can be resolved by removing the ?
from the if statement as well. It's just become habit for me in the last few years to be explicit about properties in objects that may not exist by using ??
.?
or other methods even when it wouldn't be absolutely necessary such as in this case.
Both of the errors that you're encountering are part of the built-in server that runs the app. I looked at the other three files used by the server in ./cors
and it looks like that's the only problem you'll encounter.
The actual code that runs the web site makes extensive use of the ??
and .?
operators. But it's highly unlikely you're running a browser older than roughly version 80, when they received support for these operators given their aggressive auto-update mechanisms.
Hello,
Debian Testing,
nodejs 12.22.5~dfsg-2~11u1
get the following error when running
node index.js
I can set the port manually by setting
const port = 8080;
But then, another error: