next-translate
next-translate copied to clipboard
Exclude compiled page: /_error from next-translate
What version of this package are you using?
"next-translate": "^2.0.6"
and "next-translate-plugin": "^2.0.5"
What operating system, Node.js, and npm version?
18.15.0
What happened?
I have set up next-translate
like this:
// next.config
import nextTranslate from "next-translate-plugin";
const config = {
i18n: {
locales: ["en", "nl"],
default locale: "en",
},
// ... other config
}
export default nextTranslate(config);
Note that I have not added import useTranslation from 'next-translate/useTranslation'
to any of the pages. If I use the hook, then it works as it should.
At first I thought it was an error, yet later I learned that this is how next-translate
should work.
The next-translate
seems to compile the pages/_error.tsx
which you can overwrite.
What did you expect to happen?
These messages are flooding my terminal, which is super annoying.
Is there a way to exclude pages/_error.tsx
fom being compiled by next-translate
?
Are you willing to submit a pull request to fix this bug?
Sure, yet need some pointers on why I am gettings these errors and what is the best way to debug this.
I have the same problem. Have you found a solution?
On my side next-translate prevents my _error page to properly load and it never shows on 404s or 500s, I would like to exclude it from the plugin as well, or is there another solution ?