You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property '22' of undefined
at Object. (E:\tmp\error-test.js:4:1)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:618:3
[Solution A] Assigning the array a variable name first wouldn't throw an error:
[Solution B] Adding a semicolon to the console.log(json) call would fix the error. That is: console.log(json);
And that makes me wonder if the error is in the require module/subsystem or maybe it's related to the array.
Thanks!
The text was updated successfully, but these errors were encountered:
while the missing semi-colon is understood to be the root cause, I would say the v8's source parser could do better here than coalescing them together to make a single expression. reference
error-test.json
error-test.js
Output:
[Solution A] Assigning the array a variable name first wouldn't throw an error:
[Solution B] Adding a semicolon to the
console.log(json)
call would fix the error. That is:console.log(json);
And that makes me wonder if the error is in the
require
module/subsystem or maybe it's related to the array.Thanks!
The text was updated successfully, but these errors were encountered: