Cannot read property 'map' of undefined in deconflictConstructorDeclaration
See original GitHub issue- Version:
1.3.1
- Rollup Version:
2.23.0
- Operating System and version (if applicable): N/A
- Node Version (if applicable): N/A
- Does it work with
tsc
(if applicable): ✅
Reproduction
N/A (yet)
Debug work done so far:
- Inserted a breakpoint in
deconflictConstructorDeclaration
. - Noted the value of
node
.
node.kind === 162;
node.flags === 8;
typeof node.parameters === 'undefined';
node.original.kind === 162;
node.original.flags === 256;
Array.isArray(node.original.parameters) === true;
- Noted the value of
node.original.getText()
.
private constructor(
readonly kind: SourceModuleDependencyKind,
readonly spec: string,
readonly locations: ReadonlyArray<SourceLocation>,
readonly options: SourceModuleOptions = {}
) {}
My wild guess is that there may be something weird going on with private constructors.
Expected Behavior
- Builds successfully
Actual Behavior
- Throws uncaught exception
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Cannot read property 'map' of undefined, why? - Stack Overflow
The error 'Cannot read property 'map' of undefined' is thrown when the map function in the CommentList component is executed.
Read more >How to Prevent the TypeError: Cannot Read Property Map of ...
A guide on the root cause of 'cannot read map of undefined' as well as techniques and tools to prevent this error.
Read more >Issue creating item on monday.com "Cannot read property ...
... When I test the action it says: "Cannot read property 'map' or undefined" and it shows Board ID, Group and Item ID...
Read more >Failed to analyze file [src/rucaDropdown.tsx]: Cannot read ...
ERROR: Failed to analyze file [src/rucaDropdown.tsx]: Cannot read property 'map' of undefined ... Hey there. A little formatting goes a long away, ...
Read more >TypeError Cannot read property map of undefined - React.js
js. Here's the problem: when trying to access this.props.tracks with map, it shows this error: Cannot read property map of undefined. The point ......
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 FreeTop 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
Top GitHub Comments
Alright, this has been fixed now. This only breaks in TypeScript versions before v4, but is related to this issue that I’ve just reported over at the TypeScript repo. I’ve added a simple null-check to avoid running into this pitfall. It has been released as part of v1.3.4
Just took a look at your issue. I bet you’re navigating a bit of a minefield of these sort of strictly-typed (except when they’re not) gotchas. Amazing work!