[Turbopack] fix require.resolve self hanging (#69793)
### What?
evaluation require.resolve tries to resolve and process a module during
module analytics. Since analytics is part of processing a module this
can create a call cycle when `require.resolve("./self")` is used. This
happens in some npm packages and caused Turbopack to hange.
This PR fixes that problem by only resolving the module and not
processing it when using `require.resolve`.
In addition to that it adds a panic when a call cycle occurs. The next
time we mess it up and create a call cycle this will crash Turbopack
instead of hanging, which makes it much easier to find the problem.
fixes PACK-3227
Showing
Please
register
or
sign in
to comment