nodejs / nodejs/require-in-the-middle
require('vscode') throw error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 186
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
there is a line of code in the _require function
const filename = Module._resolveFilename(id, this)
It seems to want to find the entry file of the require module. however, 'vscode' doesn't have a such file. as the result, _resolveFilename will throw error "cannot find module 'vscode' ".
Now I can only call "require('vscode')" before hook. I think it is not a good solution. Will this be fixed?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the _require function and inspect the Module._resolveFilename(id, this) call described in the report. Reproduce the failure with require('vscode') after the hook is installed, then verify that the require no longer throws while preserving the module-hooking behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100