livereactload turning `module.exports = undefined` into empty object
See original GitHub issueLodash 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:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top 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 >
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 Free
Top 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
Fixed in
3.0.0
.Finally got my thesis ready! Going to take a look at this during this week. Thanks for the patience! 😌