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.

Provide require() in console

See original GitHub issue

We should figure out a way to provide a global require() in DEV mode in the browser console. It could be implemented as a webpack plugin (everything is a plugin in webpack right?)

It could work like this:

  • For modules with unique names, require('moduleName') just works
  • For modules with non-unique names, require('./full/path/from/root') is the only way

Still not too bad!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
vjeuxcommented, Jul 24, 2016

You can try it out on facebook.com fyi, it’s super useful for debugging

1reaction
eanplattercommented, Jul 24, 2016
screen shot 2016-07-24 at 9 04 53 am

This is freaking handy indeed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I require() from the console using webpack?
First, require the module at least once. import "webpack-runtime-require";. It will then add a Require() function to the window object ...
Read more >
Requiring modules in Node.js: Everything you need to know
You can think of the require module as the command and the module module as the organizer of all required modules. Requiring a...
Read more >
Console | Node.js v19.3.0 Documentation
A global console instance configured to write to process.stdout and process.stderr . The global console can be used without calling require('node:console') .
Read more >
Getting User Input in Node.js - Codecademy
The prompt-sync Node module provides an easy-to-use alternative to this callback-based syntax. ... const prompt = require('prompt-sync')();. Notice the extra () ...
Read more >
Node.js new Console() Method - GeeksforGeeks
The console module provides a simple debugging console that is provided by web ... we need to create a console using (new Console())...
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