Advertisement
DerJackLive

Next/Font no require() on ESM Graph with top-level await

Apr 11th, 2025
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.85 KB | Help | 0 0
  1. jackr@Jacks-PC MINGW64 /d/dev/DJL Foundation/djl-homepage (main)
  2. $ pnpm build
  3.  
  4. > djl-homepage@0.1.0 build D:\dev\DJL Foundation\djl-homepage
  5. > next build
  6.  
  7.    ▲ Next.js 15.3.0
  8.    - Environments: .env
  9.    - Experiments (use with caution):
  10.      · clientTraceMetadata
  11.  
  12.    Creating an optimized production build ...
  13. <w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (245kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
  14. Failed to compile.
  15.  
  16. src\app\layout.tsx
  17. An error occurred in `next/font`.
  18.  
  19. Error: require() cannot be used on an ESM graph with top-level await. Use import() instead. To see where the top-level await comes from, use --experimental-print-required-tla.
  20.   From D:\dev\DJL Foundation\djl-homepage\node_modules\.pnpm\next@15.3.0_@babel+core@7.2_905506496932c581dfc14a516f096b03\node_modules\next\dist\build\webpack\config\blocks\css\plugins.js
  21.   Requiring D:\dev\DJL Foundation\djl-homepage\node_modules\.pnpm\prettier-plugin-tailwindcss@0.6.11_prettier@3.5.3\node_modules\prettier-plugin-tailwindcss\dist\index.mjs
  22.     at ModuleJobSync.runSync (node:internal/modules/esm/module_job:397:13)
  23.     at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:427:47)
  24.     at loadESMFromCJS (node:internal/modules/cjs/loader:1565:24)
  25.     at Module._compile (node:internal/modules/cjs/loader:1716:5)
  26.     at Object..js (node:internal/modules/cjs/loader:1899:10)
  27.     at Module.load (node:internal/modules/cjs/loader:1469:32)
  28.     at Function._load (node:internal/modules/cjs/loader:1286:12)
  29.     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
  30.     at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
  31.     at Module.<anonymous> (node:internal/modules/cjs/loader:1491:12)
  32.  
  33.  
  34. > Build failed because of webpack errors
  35.  ELIFECYCLE  Command failed with exit code 1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement