nx-expo-next-tamagui
nx-expo-next-tamagui copied to clipboard
Error [ERR_UNSUPPORTED_DIR_IMPORT] when running nx run next:serve:development
On a clean install using Node v22.2.0 (Yarn Berry), I encountered the following Error [ERR_UNSUPPORTED_DIR_IMPORT] while resolving ES modules in /node_modules/@tamagui/next-plugin/dist/esm/withTamagui.mjs:
> nx run next:serve:development
node:internal/process/promises:391
triggerUncaughtException(err, true /* fromPromise */);
^
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/nx-expo-next-tamagui-main/node_modules/next/dist/build/webpack/config/blocks/css' is not supported resolving ES modules imported from /nx-expo-next-tamagui-main/node_modules/@tamagui/next-plugin/dist/esm/withTamagui.mjs
Did you mean to import "next/dist/build/webpack/config/blocks/css/index.js"?
at finalizeResolution (node:internal/modules/esm/resolve:254:11)
at moduleResolve (node:internal/modules/esm/resolve:920:10)
at defaultResolve (node:internal/modules/esm/resolve:1119:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:511:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
code: 'ERR_UNSUPPORTED_DIR_IMPORT',
url: 'file:///nx-expo-next-tamagui-main/node_modules/next/dist/build/webpack/config/blocks/css'
}
Node.js v22.2.0