Closed joiglifberg closed 3 weeks ago
This is expected, importing from next.config.mjs
is really not supported.
Alternatives:
trailingSlash
in a shared module that is consumed by next.config.mjs
and your Route Handlernext.config.mjs
based on trailingSlash
and read that in your Route HandlerHope this helps!
Description
Importing next.config.mjs to an api route causes the api route to crash (on Vercel) with the following:
Error: Could not find i18n config at ./i18n/request.ts, please provide a valid path.
The reason for importing the config (in our case) was to check if the option
trailingSlash
was active or not.Verifications
Mandatory reproduction URL
...
Reproduction description
Steps to reproduce:
Expected behaviour
I expect the import to work as it did before using next-intl.