-
-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NextJS build fails with next-i18next when target is set to serverless #1311
Comments
Can you provide official documentation on |
Please see: vercel/next.js#20487 (comment) |
Thank you for your quick answer! Here I'm focusing on deployment on Netlify, which is my target environment as you can guess. Unfortunately, removing
So I tried with I'm not very satisfied with this trial-and-error process, but clearly this has nothing to do with next-i18next anymore. Thanks again! |
Encountering the same issue |
@madshargreave Does experimental-serverless-trace help? |
I created this issue: netlify/next-runtime#595 |
I'm having the same issue using |
Anyone solve this problem? |
Would you solve this problem? |
Not yet. Currently I'm deploying on Vercel's servers stead of configure my own deploy with |
Has anyone found a solution to the problem? |
Describe the bug
When a NextJS app is built with
npm run build
whiletarget
is set toserverless
innext.config.js
, the build fails with:Occurs in next-i18next version
next-i18next Npm package version 8.5.3
Steps to reproduce
With a sample project
Positive case:
Now, edit
next.config.js
and uncomment the line//target: 'serverless',
. Then, build again:From scratch
To re-create the demo project above and check for yourself:
yarn create next-app
common.json
(make them empty)next-i18next.config.js
next.config.js
pages/_app.js
getStaticProps
topages/index.js
Then proceed as above:
npm run build
: it workstarget: 'serverless'
innext.config.js
, runnpm run build
again: it failsExpected behaviour
Build should succeed with
target
set toserverless
. Or there should be a documented workaround.Additional context
Note that
serverless
is a requirement for Netlify, which is a mainstream way to deploy Next. Therefore, this issue might be often encountered.This issue has already been described in #911 . I opened a new one because I felt the title was clearer, plus it comes with a demo repos to reproduce it.
The text was updated successfully, but these errors were encountered: