Closes PACK-3244
Closes https://github.com/vercel/next.js/issues/69562
Await the module in both environments (SSR/browser), if it's async in at
least one of them.
We can't and don't want to make the browser module async (artifically)
if the SSR module is async (due to ESM externals).
The only concern regarding `async` not always being true in the manifest
was that we don't want to await in non TLA cases (e.g. CJS exporting a
promise, etc...).
But the SSR module being ESM with TLA and the browser module being CJS
with a Promise export is exceedingly unlikely.
### What?
* rename test case
* improve error message and handle edge case for require resolving
* fix test case actually testing externals (webpack was silently
bundling, Turbopack showed error that helped to find the broken test
case)
### Why?
### How?
Closes PACK-2662
We switched to `pnpm` for testing instead of `yarn` for e2e tests
containing customized node_modules packages, it works with
`node_modules` folder before. Rename the existing `node_modules_bak`
hack to make it easy to test with.
Previously we use `yarn` but it will clean `node_modules` folder so we
have to use another script to copy packages, it's not a required thing
now so we can test package from node_modules directly without renaming
folders locally
Closes NEXT-2496