Skip to content

refactor(nextjs): Change ESM interop. to remove lazy loading#22193

Open
timfish wants to merge 3 commits into
developfrom
timfish/fix/esm-interop
Open

refactor(nextjs): Change ESM interop. to remove lazy loading#22193
timfish wants to merge 3 commits into
developfrom
timfish/fix/esm-interop

Conversation

@timfish

@timfish timfish commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Code like this always points to an ESM/CJS interop issue:

const codeTransformerWebpack = mod.default ?? (mod as unknown as NonNullable<typeof mod.default>);

This is caused by our repo-wide Rollup setting of interop: 'esModule'. This is required for us to be able to monkey patch Node built-ins but causes the above issues with CJS dependencies that use the classic CJS default export (module.exports = fn).

This PR overrides the interop setting for the suspect package and removes the lazy dependency loading.

@timfish timfish changed the title fix(nextjs): Fix ESM interop. to remove lazy loading fix(nextjs): Change ESM interop. to remove lazy loading Jul 10, 2026
@timfish timfish marked this pull request as ready for review July 11, 2026 13:41
@timfish timfish requested review from a team as code owners July 11, 2026 13:41
@timfish timfish requested review from andreiborza, chargome, isaacs, mydea and s1gr1d and removed request for a team July 11, 2026 13:41
cursor[bot]

This comment was marked as outdated.

@timfish timfish changed the title fix(nextjs): Change ESM interop. to remove lazy loading refactor(nextjs): Change ESM interop. to remove lazy loading Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant