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 '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:

  1. Inserted a breakpoint in deconflictConstructorDeclaration.
  2. 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;
  1. 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:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wessbergcommented, Sep 2, 2020

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

0reactions
ggoodmancommented, Sep 3, 2020

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!

Read more comments on GitHub >

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

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