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

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

Closed
zaratan opened this issue May 3, 2021 · 12 comments
Labels
bug Issue was opened via the bug report template. please verify canary The issue should be verified against next@canary. It will be closed after 30 days of inactivity

Comments

@zaratan
Copy link

zaratan commented May 3, 2021

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

@zaratan zaratan added the bug Issue was opened via the bug report template. label May 3, 2021
@adrai
Copy link

adrai commented May 16, 2021

deactivating webpack5 does not seem to work (at least for me)

Theoretically (semver), v10.2.0 should have been v11.0.0

@zaratan
Copy link
Author

zaratan commented May 16, 2021

Interesting 🤔 Because for me, this commit: zaratan/index@2099c72 fixed the problem

@adrai
Copy link

adrai commented May 16, 2021

Interesting 🤔 Because for me, this commit: zaratan/index@2099c72 fixed the problem

@zaratan Can you also try this on the simple example of next-i18next?

@zaratan
Copy link
Author

zaratan commented 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.

@vexxvakan
Copy link

Yes, this does indeed work. But I don't see any reason as why I would wait out on Webpack5. Also next-i18next does work on the production build. it compiles fine. it just crashes the dev server in an infinite loop for me. so basically it keeps loading localhost and doesnt throw any error.

@adrai
Copy link

adrai commented May 16, 2021

may be related: i18next/next-i18next#1202 (comment) #24700

@AhsanNissar
Copy link

Hi guys, facing the same issue but not using webpack 5. Please check out this thread #25311

@adrai
Copy link

adrai commented Sep 9, 2021

fyi: i18next/next-i18next#1384

@jankaifer jankaifer added the please verify canary The issue should be verified against next@canary. It will be closed after 30 days of inactivity label Nov 30, 2022
@github-actions
Copy link
Contributor

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the please add a complete reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository (template), but you can also use a tool like CodeSandbox or StackBlitz.

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue.

Please test your reproduction against the latest version of Next.js (next@canary) to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the please add a complete reproduction label that receives no meaningful activity (e.g. new comments with a reproduction link) are automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the 👍 reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

@skyeinthecloud
Copy link

I'm having this issue too. Deactivating webpack5 in the config did nothing :(

@balazsorban44
Copy link
Member

This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. please verify canary The issue should be verified against next@canary. It will be closed after 30 days of inactivity
Projects
None yet
Development

No branches or pull requests

7 participants