Replies: 1 comment
-
One workaround I made is by adding a custom plugin to webpack, that copy those files First I add cpr for having cross-platform cp -r cli command
Then add copyFigletFonts to your package.json scripts
Then in your next.config.ts add this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I created a new next.js app using npx create-next-app@latest (next.js 15 at the current time)
Then I removed the node_module folder and run
pnpm install
It was successful and with
pnpm run dev
I saw the default home page of create-next-app
Then I install figlet using pnpm and use it in my home page file.
At this point I get this error in home page:
During searches, I found out that Next.js will automatically trace each page and its dependencies to determine all of the files that are needed for deploying. It statically analyze import, require, and fs usage to determine all files that a page might load https://nextjs.org/docs/pages/api-reference/config/next-config-js/output
But it somehow failed to trace figlet fonts
And figlet Getting Started - Webpack / React recommend to import fonts using importable-fonts (and this workaround actually works and mandatory for client components)
But I used to use figlet without importable-fonts Is there any way to tell next.js that copy figlet fonts to .next/server folder?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions