Currently, importing a module only for its side effect results in an
`ERR_TYPES_NOT_FOUND` error with `nodeModulesDir=manual`.
---------
Co-authored-by: David Sherret <dsherret@gmail.com>
Fixes a case reported in discord. At runtime node (and us) would fail on
this, but all major bundlers permit this. So as a fix, just allow it
during bundling only.
This further improves `import.meta.resolve` to not error in many more
scenarios (better alignment with Node).
1. Non-existent files in npm packages
1. Non-existent built-in node modules (ex. `node:non-existent`)
1. Many things that were previously errors with byonm.
1. No longer surfaces some deno_graph resolution errors
Additionally, this defers resolving npm specifiers until loading for
dynamic imports in order to have `prepare_load` properly install them
loading. Before it could potentially error when loading the same npm
specifier on multiple workers (reason for flaky
`specs::npm::worker_shutdown_during_npm_import`).