question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property of 'name' of undefined

See original GitHub issue

When 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:closed
  • Created 4 years ago
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
tleclairecommented, Mar 5, 2020

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” ] }

1reaction
exaucaecommented, Mar 22, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found