Cannot read property of 'name' of undefined
See original GitHub issueWhen I package a simple data transfer to a 3rd party API to an Winx64 .exe via the node pkg package, I get this error.
C:\Users\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\build>registria-win.exe -s "daisy" -b "LIN01" -r "1049315-1049318
TypeError: Cannot read property 'name' of undefined
at convertDataToProperty (C:\snapshot\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\node_modules\typescript-json-serializer\index.js:164:24)
at C:\snapshot\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\node_modules\typescript-json-serializer\index.js:92:29
at Array.forEach (<anonymous>)
at Object.deserialize (C:\snapshot\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\node_modules\typescript-json-serializer\index.js:90:10)
at RegistriaData.<anonymous> (C:\snapshot\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\build\registriaData.js)
at step (C:\snapshot\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\build\registriaData.js)
at Object.next (C:\snapshot\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\build\registriaData.js)
at fulfilled (C:\snapshot\Jbaszler\OneDrive\Documents\Personal Stuff\Larson\Code Projects\Registria\registriaBackEnd\build\registriaData.js)
It runs just fine in the dev/debug environment. I’ve attached the few files that are in play for this.
psRegistria.ts.txt
registriaData.ts.txt
tsconfig.json.txt
nodemon.json.txt
package.json.txt
registria.ts.txt
Issue Analytics
- State:
- Created 4 years ago
- Comments:23 (10 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'name' of undefined
This type of error mean that your container variable file is not defined. You should use console.log at different places to see what...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
The TypeError : Cannot read property of undefined is one of the most common type errors in JavaScript. It occurs when a property...
Read more >Uncaught TypeError: Cannot read property 'name' of undefined
It is a very common error when working with object and array to get a TypeError: Cannot read property 'name' of undefined ....
Read more >5.2 - TypeError: Cannot read property 'name' of undefined
5.2 - loop the loop - TypeError: Cannot read property 'name' of undefined. I get an error but still get a pass. Also...
Read more >Cannot read property 'name' of undefined - WordPress.org
`Cannot read property 'name' of undefined. Resolved leo1951. (@leo1951) ... I also get the following error some times: Data error in Analytics
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed this by adding “emitDecoratorMetadata”:true to the compiler options in tsconfig.json.
{ “extends”: “./node_modules/gts/tsconfig-google.json”, “compilerOptions”: { “experimentalDecorators”: true, “emitDecoratorMetadata”:true, “target”: “es5”, “rootDir”: “.”, “forceConsistentCasingInFileNames”: false, “outDir”: “build” }, “include”: [ “src//*.ts", "test//*.ts” ] }
Works fine now, @GillianPerard ! I assume it was a peer dependencies depth. That’s one one those weird things you can’t explain properly. 😃
This issue is closable. Thanks for the replies.