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.

livereactload turning `module.exports = undefined` into empty object

See original GitHub issue

Lodash is breaking with the following error when used through livereactload:

Uncaught TypeError: Map is not a constructor

The cause seems to be that _Map.js in lodash is exporting undefined, but then in _getTag.js, require('./_Map') is receiving {}, causing a falsy check further down the file to fire incorrectly.

I faced the same problem in another scenario a while ago, so it isn’t just lodash: although I can’t remember the exact details.

This seems to be the line of code causing the problem: https://github.com/milankinen/livereactload/blob/master/src/requireOverride.js#L17

cc @djgrant (we are both trying to figure out a fix right now)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
milankinencommented, Aug 19, 2016

Fixed in 3.0.0.

1reaction
milankinencommented, Jul 6, 2016

Finally got my thesis ready! Going to take a look at this during this week. Thanks for the patience! 😌

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js Module.Exports Undefined Empty Object
I just ran into a circular dependency type thing. I didn't know it was called that, but yes that sounds like the correct...
Read more >
[BUG] [2.5.6] import of npm library gives empty object #11900
Blocker: Unable to run a Meteor app because import of a library returns an empty object, as described in all these threads: #10065 ......
Read more >
Why this is an empty object when module.exports is assigned ...
The exports variable is available within a module's file-level scope, ... If you assign a new object to module.exports , then just that...
Read more >
no-useless-empty-export - TypeScript ESLint
An empty export {} statement is sometimes useful in TypeScript code to turn a file that would otherwise be a script file into...
Read more >
Undefined object after export - Node.js - JavaScript - SitePoint
Hello, I hope you can help me to resolve my problem. So I want to export an object from the file 'hostconf.js' and...
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