Package isolation on a Next.js app: `Can't resolve './out/isolated_vm'`
What version of Bun is running?
1.3.0+b0a6feca5
What platform is your computer?
Darwin 25.0.0 arm64 arm
What steps can reproduce the bug?
- Clone Turborepo kitchen-sink example
- Make sure to use bun v1.30 to have package isolation
- Import
isolated-vmanywhere in storefront (Next.js app) - Run build
What is the expected behavior?
The same steps work fine with hoisted strategy
What do you see instead?
Module not found: Can't resolve './out/isolated_vm' error
Additional information
No response
Most likely due to how EXTERNAL_PACKAGES is matched against their optOutBundlingPackageRegex regex?
https://github.com/vercel/next.js/blob/d0ffcfcb3774731d1baef017c0c329ef2d1d6c89/packages/next/src/build/webpack-config.ts#L876C3-L885C4
isolated_vm is indeed listed in their default external packages list: https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/server-external-packages.json
The resolvers fail to consistently resolve these relative symlinks when resolving from different starting points (importing module context vs project root), causing the verification to fail.
Both webpack and turbopack are failing here