Closed
Descripti 8B10 on
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
17.0.1
What operating system are you using?
all
Operating System Version
all
What arch are you using?
all
Last Known Working Electron version
9.4.4
Expected Behavior
- Should throw a
MODULE_NOT_FOUND
error OR - The difference between Electron's and Node.js'
require()
should be documented
Actual Behavior
It requires the 'electron' module instead.
Testcase Gist URL
https://gist.github.com/RaisinTen/dfe8c9ccc8345c656dcf0d21825c4b7f
Additional Information
- This is a continuation of [Bug]:
require('electron/package.json')
inside an electron process requires the'electron'
module instead #32951 which was closed because requiringelectron/package.json
is not expected behaviour. This issue however, only focuses on the part where we decide whether we should allow users to require modules with names falling into this regex -electron/.*
(notpackage.json
in particular). - This is likely happening due to the way
electron/lib/common/reset-search-paths.ts
Lines 55 to 61 in b1463d2