You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
turbopack has trouble with .cjs files inside esm build
│ Import trace for requested module:
│ ../../node_modules/@logtape/logtape/esm/nodeUtil.cjs
│ ../../node_modules/@logtape/logtape/esm/nodeUtil.js
│ ../../node_modules/@logtape/logtape/esm/formatter.js
│ ../../node_modules/@logtape/logtape/esm/mod.js
│ ./src/lib/logger.ts
│ ./src/app/layout.tsx
│ ⚠ ../../node_modules/@logtape/logtape/esm/fs.cjs
│ Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
│
│ ../../node_modules/@logtape/logtape/esm/nodeUtil.cjs
│ Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
The text was updated successfully, but these errors were encountered:
I guess this issue has similar root cause as #19. If we import { **everything** } from '@logtape/logtape';, each export has to be compatible with all environments (Node, Deno, Browser, edge, bundlers, etc.). Dependencies like require("node:fs") are quite hard to mask so that they are only used when needed. Something like this would work without hacks:
is that they are not robust long-term. Even if there are no known issues reported at the moment, the situation may degrade with a change in some bundler at any time.
turbopack has trouble with
.cjs
files inside esm buildThe text was updated successfully, but these errors were encountered: