question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

yarn build with Webpack 5 + next-18next fails with Error: ENOENT: no such file or directory

See original GitHub issue

What version of Next.js are you using?

10.2.0

What version of Node.js are you using?

v14.15.3

What browser are you using?

N/A

What operating system are you using?

macOS + Vercel (Bug appear in both)

How are you deploying your application?

Vercel

Describe the Bug

I tried adding next-i18next on a brand new project.

I followed the installation path described in the repo. and everything was working in dev.

Running yarn build gives me back:

info  - Generating static pages (9/9)

> Build error occurred
[Error: ENOENT: no such file or directory, rename '/Users/denispasin/Projects/index/.next/export/fr.html' -> '/Users/denispasin/Projects/index/.next/server/pages/fr.html'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'rename',
  path: '/Users/denispasin/Projects/index/.next/export/fr.html',
  dest: '/Users/denispasin/Projects/index/.next/server/pages/fr.html'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

If I deactivate Webpack 5 in next.config.js with:

module.exports = {
  future: {
    webpack5: false,
  },
};

I don’t have the error anymore. Also I have one more supposedly page generated: Generating static pages (10/10)

Expected Behavior

I should not have an error.

To Reproduce

You can clone this repo at the right commit: 496ede5fe23c79e3227da1622155123ccf83e04b.

This commit was basically:

Run yarn build

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
zaratancommented, May 16, 2021

Not right now. I’m not on a computer at the moment. Sorry 😅 I’ll try to remember to test that tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module build failed: Error: ENOENT: no such file or directory
I just started a new project using React with Webpack. I keep getting the same error when serving the app.
Read more >
To v5 from v4 - webpack
Webpack 5 requires at least Node.js 10.13.0 (LTS), so make sure you ... Make sure your build has no errors or warnings ......
Read more >
Yarn install throwing errors - sage - Roots Discourse
warning "postcss-html@0.12.0" has incorrect peer dependency "sugarss@>=1.0.0". error An unexpected error occurred: "ENOENT: no such file or directory, open '/ ...
Read more >
React Webpack deployment failed: ENOENT: no such file or ...
So I tried to deploy a react app by building it with webpack.Building went well as it as it would locally.However, after a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found