Experience-Monks / Experience-Monks/devtool
Relative `require` paths do not work in the Console
Open
- Dominant language
- JavaScript
- Stars
- 3.7k
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Description
Assuming I'm in the parent directory of the module I'm attempting to `require`...
``` sh
devtool
```
Then type in the Console:
``` js
require('./my-module') // throws error: Cannot find module './my-module'
```
Since no `__dirname` exists in the Console, the relative `require` cannot be resolved by Electron.
---
The workaround:
``` js
require(process.cwd() + '/my-module')
```
Contributor guide
Assessment
This issue has not been assessed yet.