mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
I set it to `::Unknown` because we the runtime may or may not support module-sync. So let's just trace both for now There is one problem though: https://nodejs.org/docs/latest-v26.x/api/packages.html#conditional-exports > "module-sync" - matches no matter the package is loaded via import, import() or require(). The format is expected to be ES modules that does not contain top-level await in its module graph - if it does, ERR_REQUIRE_ASYNC_MODULE will be thrown when the module is require()-ed. So we have multiple options: 1. We definitely want to respect module-sync for tracing. We don't really have to throw ERR_REQUIRE_ASYNC_MODULE here, Node.js will do it at runtime anyway. 2. ~~What about bundling? Either~~ - ~~Respect module-sync always, but don't throw ERR_REQUIRE_ASYNC_MODULE.~~ - ~~Respect module-sync always, and do throw a build error the module requires TLA. This would require a separate validation pass though.~~ - I'm not enabling it for bundling for now
8 lines
289 B
JavaScript
8 lines
289 B
JavaScript
;[
|
|
// @vercel/nft outputs fallback.js here instead, but I think that's wrong?
|
|
'test/unit/module-sync-condition-es/import.js',
|
|
'test/unit/module-sync-condition-es/input.js',
|
|
'test/unit/module-sync-condition-es/module-sync.js',
|
|
'test/unit/module-sync-condition-es/package.json',
|
|
]
|