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
Describe the bug
I want to use fumadocs , and according to its documentation, I can only use next.config.mjs, so I modified the next.config.ts of apps/web to mjs, but directly refer to feature-flags/lib/toolbar, I get the following error:
So I modified it to: feature-flags/lib/toolbar.ts, which works well locally, and when I try to deploy to vercel, I get an error:
⨯ Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
web:build:
web:build: > Build error occurred
web:build: TypeError: Unknown file extension ".ts" for /vercel/path0/packages/feature-flags/lib/toolbar.ts
web:build: at Object.getFileProtocolModuleFormat [as (file:] (node:internal/modules/esm/get_format:219:9) {
web:build: code: 'ERR_UNKNOWN_FILE_EXTENSION'
next-forge version
I am using version 4.2.6
The text was updated successfully, but these errors were encountered:
Hey @allentown521, I'm familiar with the issue - that's difficult 😞
Basically it's erroring because .mjs files can't import .ts files easily, but I'm aware that Fumadocs needs .mjs to function.
I think you may need to find all the files that your new next.config.mjs file imports (like packages/feature-flags/lib/toolbar and rework them to .mjs as well.
I guess this is a solution, but it's destructive, maybe they should be mjs files, and other similar products use mjs, in addition to fumadocs.
But what puzzles me is why my local build is normal and only has this problem when deployed to vercel. Can we try to solve this problem from this perspective?
Describe the bug
I want to use fumadocs , and according to its documentation, I can only use next.config.mjs, so I modified the next.config.ts of apps/web to mjs, but directly refer to feature-flags/lib/toolbar, I get the following error:
⨯ Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
So I modified it to: feature-flags/lib/toolbar.ts, which works well locally, and when I try to deploy to vercel, I get an error:
⨯ Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
web:build:
web:build: > Build error occurred
web:build: TypeError: Unknown file extension ".ts" for /vercel/path0/packages/feature-flags/lib/toolbar.ts
web:build: at Object.getFileProtocolModuleFormat [as (file:] (node:internal/modules/esm/get_format:219:9) {
web:build: code: 'ERR_UNKNOWN_FILE_EXTENSION'
next-forge version
I am using version 4.2.6
The text was updated successfully, but these errors were encountered: