module.require isn't present
See original GitHub issueIn node.js, module.require
is the basis for the require
function. Browserify instead directly hands the require
function over, without exposing any functionality as module.require
.
I’m trying to browserify a module that uses defaultable, which heavily depends on the behavior of node.
It would be awesome if module.require
could be at least a reference to the require
function.
Issue Analytics
- State:
- Created 10 years ago
- Comments:8
Top Results From Across the Web
Module not found error in node.js - Stack Overflow
Use: require('./utils.js'); . This is the correct way to require a module from a file which is located in required module's folder.
Read more >Fix "require is not defined" in JavaScript/Node - Stack Abuse
The require method is not available in the browser. To solve this, you have a few options, a few of which we'll briefly...
Read more >How to fix "require is not defined" in JavaScript / Node.js?
Learn what is "require-is-not-defined" error in JavaScript, when they occur, and how you can fix it in both browser and Node.js environment.
Read more >How to fix the error `require is not defined` in Node.js
Today I started writing a new project on Node.js and got this error on the very first run: const express = require('express'); ...
Read more >How To Fix ReferenceError require is not defined in JavaScript
In this case, check your package.json file for an property called type . If that is set to module , ES6 modules will...
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
@substack, would it be possible for this to be optional or even un-documented?
We might argue about what constitutes “hacky overriding.” What I know is that we are using @fb55’s code in production and it works well. I agree with your point about spending bytes in every bundle; but I also agree with Felix’s point that supporting a documented (stability = 5, locked) feature would be nice.
We will be okay either way, just asking you to reconsider. Thanks.
I’m not convinced that this feature is worth supporting since it would only enable hacky overriding that probably shouldn’t be done in the first place at the expense of extra bytes in every browserify bundle.