next.js
6779a5c0 - Turbopack: error when importing Typescript in node_modules (#83990)

Commit
194 days ago
Turbopack: error when importing Typescript in node_modules (#83990) Webpack treats TS files in node_modules as Javascript files (i.e. you get a JS parse error) Turbopack previously did a similar thing (though it parsed as Typescript, but then never ran the TS AST transform). This never worked properly, it failed due to some unreachable assertion in the swc transforms. Now it fails with a proper error ~~, though too many of them~~: ``` ./node_modules/.pnpm/pkg@file+pkg/node_modules/pkg/index.ts Missing module type The module type effect must be applied before adding Ecmascript transforms ./node_modules/.pnpm/pkg@file+pkg/node_modules/pkg/index.ts Unknown module type This module doesn't have an associated type. Use a known file extension, or register a loader for it. Read more: https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders at ignore-listed frames ``` Additionally: don't run styled-jsx/styled-components/relay/... in node_modules in the server. This aligns it what we already had configured for the client context
Author
Parents
Loading