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.

How could I use this:

import installExtension, { REACT_DEVELOPER_TOOLS } from ‘electron-devtools-installer’;

installExtension(REACT_DEVELOPER_TOOLS) .then((name) => console.log(Added Extension: ${name})) .catch((err) => console.log('An error occurred: ', err));

With node require imports?

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
jorfermocommented, Oct 11, 2016

Ok, I was calling the methods before the app is ready.

Calling them inside the createWindow function fixed the errors

1reaction
jorfermocommented, Sep 27, 2016

That throws this error

An error occurred:  TypeError: BrowserWindow.addDevToolsExtension is not a function
  at ./node_modules/electron-devtools-installer/dist/index.js:71:30
  at process._tickCallback (internal/process/next_tick.js:103:7)
  at Module.runMain (module.js:592:11)
  at run (bootstrap_node.js:402:7)
  at startup (bootstrap_node.js:157:9)
  at bootstrap_node.js:521:3
Read more comments on GitHub >

github_iconTop Results From Across the Web

Requiring modules in Node.js: Everything you need to know
Node uses two core modules for managing module dependencies: The require module, which appears to be available on the global scope — no...
Read more >
What is this JavaScript "require"? - Stack Overflow
the CommonJS (CJS) format, used in Node.js, uses a require function and module.exports to define dependencies and modules. The npm ecosystem is built...
Read more >
How NodeJS Require works! | Thirdock Techkno
require () is used to consume modules. It allows you to include modules in your app. You can add built-in core Node.js modules,...
Read more >
What is require? - Node.js
The basic functionality of require is that it reads a JavaScript file, ... example2.js')() //require itself and run the exports object.
Read more >
Using import and require in the same file - Node JS - YouTube
Found solution here: https://www.kindacode.com/article/node-js-how-to-use-import-and- require -in-the-same-file/
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