require
doesn't resolve in the global cache dir if referrer is not in DENODIR
#25189
Labels
require
doesn't resolve in the global cache dir if referrer is not in DENODIR
#25189
The scenario is roughly as follows:
You're using the global resolver (no node_modules dir) and you have a config file
Playwright (which is in the global cache dir) adds a hook that gets called right before the builtin
require
, thenrequires
your config file (require(userConfigFilePath)
).Playwright's require hook transpiles your config file to CJS, which results in
then calls deno's actual require function.
When deno hits
require("playwright/test");
it searches relative to the config file (but no matches), then searches in "/node_modules", "/../node_modules" (etc.) but there are no matches, because the dependency is actually in the global cache dir.Ideally we could handle this by resolving in the global cache dir instead of in the
node_modules
dirs (which don't exist or apply).Seen in #16899 (comment) (repro at https://github.com/jollytoad/ahx/tree/df1b391bb5adb51e879da17612570f7e7dd025f7)
The text was updated successfully, but these errors were encountered: