Skip to content
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

Vercel deployment fails: Error occurred prerendering page "/en" #1262

Closed
keremcanb opened this issue Jun 16, 2021 · 1 comment
Closed

Vercel deployment fails: Error occurred prerendering page "/en" #1262

keremcanb opened this issue Jun 16, 2021 · 1 comment

Comments

@keremcanb
Copy link

keremcanb commented Jun 16, 2021

EDIT: I forgot to add environment variables, this was the reason for this error. But still except home page most pages are throwing 404 not found error.

Describe the bug

I've done configuration exactly according to the documentation, but Vercel deployment fails with following log.

info  - Generating static pages (0/15)
15:53:38.356 | react-i18next:: You will need to pass in an i18next instance by using initReactI18next
15:53:38.360 | react-i18next:: You will need to pass in an i18next instance by using initReactI18next
15:53:38.371 | info  - Generating static pages (3/15)
15:53:38.377 | react-i18next:: You will need to pass in an i18next instance by using initReactI18next
15:53:38.395 | info  - Generating static pages (7/15)
15:53:38.455 | info  - Generating static pages (11/15)
15:53:38.465 | Error occurred prerendering page "/tr". Read more: https://nextjs.org/docs/messages/prerender-error
15:53:38.465 | Error: connect ECONNREFUSED 127.0.0.1:80
15:53:38.465 | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
15:53:38.469 | Error occurred prerendering page "/en". Read more: https://nextjs.org/docs/messages/prerender-error
15:53:38.469 | Error: connect ECONNREFUSED 127.0.0.1:80
15:53:38.470 | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
15:53:38.470 | info  - Generating static pages (15/15)
15:53:38.472 | > Build error occurred
15:53:38.474 | Error: Export encountered errors on following paths:
15:53:38.474 | /en
15:53:38.475 | /tr
15:53:38.475 | at /vercel/path0/node_modules/next/dist/export/index.js:31:1106
15:53:38.475 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
15:53:38.475 | at async /vercel/path0/node_modules/next/dist/build/index.js:43:49
15:53:38.475 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
15:53:38.475 | at async /vercel/path0/node_modules/next/dist/build/index.js:25:1475
15:53:38.475 | at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
15:53:38.542 | error Command failed with exit code 1.
15:53:38.542 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
15:53:38.562 | Error: Command "yarn run build" exited with 1

Occurs in next-i18next version

^8.4.0

Configuration files

next.config.js:

const { i18n } = require('./next-i18next.config');

module.exports = {
  future: {
    webpack5: true
  },
  i18n
};

next-i18next.config.js:

module.exports = {
  i18n: {
    defaultLocale: 'en',
    locales: ['en', 'tr']
  }
};

_app.tsx:

import { AppProps } from 'next/app';
import { appWithTranslation } from 'next-i18next';

const MyApp = ({ Component, pageProps }: AppProps) => (
      <Component {...pageProps} />
);

export default appWithTranslation(MyApp);
@isaachinman
Copy link
Contributor

Duplicate of #1202.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants