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.

ReferenceType has undefined type

See original GitHub issue

I get the an undefined error trying to parse MyType.

import { View, ViewStyle, StyleProp } from 'react-native';
export type MyType = StyleProp<ViewStyle>
TypeError: Cannot read property 'getId' of undefined
    at ReferenceType.getId (/Users/awinograd/programming/ts-json-schema-generator/dist/src/Type/ReferenceType.js:12:26)                                                                                    
    at (.types.map (/Users/awinograd/programming/ts-json-schema-generator/dist/src/Type/UnionType.js:11:25)                                                                                                
    at Array.map (<anonymous>)
    at UnionType.getId (/Users/awinograd/programming/ts-json-schema-generator/dist/src/Type/UnionType.js:10:33)                                                                                            
    at ids.join.<.context.getArguments.map (/Users/awinograd/programming/ts-json-schema-generator/dist/src/CircularReferenceNodeParser.js:33:78)                                                           
    at Array.map (<anonymous>)
    at CircularReferenceNodeParser.createCacheKey (/Users/awinograd/programming/ts-json-schema-generator/dist/src/CircularReferenceNodeParser.js:33:61)                                                    
    at CircularReferenceNodeParser.createType (/Users/awinograd/programming/ts-json-schema-generator/dist/src/CircularReferenceNodeParser.js:13:26)                                                        
    at ChainNodeParser.createType (/Users/awinograd/programming/ts-json-schema-generator/dist/src/ChainNodeParser.js:17:50)                                                                                
    at ExpressionWithTypeArgumentsNodeParser.createType (/Users/awinograd/programming/ts-json-schema-generator/dist/src/NodeParser/ExpressionWithTypeArgumentsNodeParser.js:23:41) 

So far, I’ve figured out that getId is called in createType before the returned value is actually set on the reference on the same line in CircularReferenceNodeParser

https://github.com/vega/ts-json-schema-generator/blob/c0f13a0c8aa01a4bba22c0e46de33585677a39b0/src/CircularReferenceNodeParser.ts#L26

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
awinogradcommented, Sep 27, 2018
1reaction
domoritzcommented, Sep 27, 2018

I recommend https://astexplorer.net/ to look at what is actually defined.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Record is using a reference type undefined in this output style"?
This link answer the question on what do I do if I get an error message that says "Record is using a reference...
Read more >
How to resolve "[Record #9063 is using a reference type ...
“[Record #9063 is using a reference type undefined in this output style.]” (the second one has a different record #).
Read more >
Reference Type Within itself, TypeScript - Stack Overflow
This generic mapped type takes an object Routes and maps it to a new object with the same keys, but the values are...
Read more >
ReferenceType (Java Debug Interface ) - Oracle Help Center
For arrays ( ArrayType ) and primitive classes, the return value is undefined. Returns: true if this type is abstract; false otherwise. isFinal....
Read more >
What does this mean: [Record #2776 is using a reference type ...
[Record #2573 is using a reference type undefined in this output style.] What does it mean and how can I resolve the problem?...
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