Skip to content

processContextHashSnapshot(path, tsh.hash) throws error #14441

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

Closed
getTobiasNielsen opened this issue Oct 8, 2021 · 13 comments · Fixed by #14474
Closed

processContextHashSnapshot(path, tsh.hash) throws error #14441

getTobiasNielsen opened this issue Oct 8, 2021 · 13 comments · Fixed by #14474

Comments

@getTobiasNielsen
Copy link

getTobiasNielsen commented Oct 8, 2021

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

Running npx next build

Causes the following error:
info - Creating an optimized production build . project-path\node_modules\next\dist\compiled\webpack\bundle5.js:59190 processContextHashSnapshot(path, tsh.hash);
^

TypeError: Cannot read property 'hash' of null

If the current behavior is a bug, please provide the steps to reproduce.

All I assumingly did was adding a layout and components, e.g. footer

What is the expected behavior?

Building instead of failing, or failing gracefully

Other relevant information:
webpack version: 5.58.1 (that came with the next version)
next: 11.1.2

Solution:
I deleted .next to fix this. I'd run vercel --force to skip the build cache if I was on vercel.

If a webpack dev wants to, they can get access to the private repo, and see the differences between the commits in detail.

@alexander-akait
Copy link
Member

alexander-akait commented Oct 8, 2021

Please open an issue in nextjs

@sokra sokra reopened this Oct 8, 2021
@getTobiasNielsen
Copy link
Author

I also added it to vercel/next.js#29752

@alexander-akait
Copy link
Member

@getTobiasNielsen Can you provide steps to reproduce?

@getTobiasNielsen
Copy link
Author

Yep, I can switch between two different branches, and it's on the build in one, but not in the other.

As previously stated, I just changed some html into components. After trying to build that commit, I have to clean the cache, or I get the error in question.

The offer for access still stands.

@alexander-akait
Copy link
Member

Something changes more except HTML? Maybe package.json? Maybe you have hooks on install deps on switching branches

@getTobiasNielsen
Copy link
Author

Something changes more except HTML? Maybe package.json? Maybe you have hooks on install deps on switching branches

I wish it so.

Here's everything that's being done.

123qwe123qwe - Copy

I tried re-adding the api folder and hello.ts, but didn't change anything.

@alexander-akait
Copy link
Member

Thanks for feedback

@getTobiasNielsen
Copy link
Author

We're about to decide to publish the repo, just waiting for peoples consent. Should give you more to work with.

@getTobiasNielsen
Copy link
Author

I specifically deleted the client-production cache of webpack, to clear the problem

@getTobiasNielsen
Copy link
Author

https://github.com/Publica-Fides/publica-fides-webapp

There are two branches, switching between test4 and test5 and building them with npx next build should introduce the error.

Let me know if you are able to.

sokra added a commit that referenced this issue Oct 13, 2021
sokra added a commit that referenced this issue Oct 13, 2021
@dominicarrojado
Copy link

I still get this error when building my Next.js app in GitHub actions. 🤔 Although when I build the app in my local machine, no issues, even when deleting my node_modules folder and yarn.lock. Do you guys have an idea?

@alexander-akait
Copy link
Member

@dominicarrojado Maybe CI cache?

@dominicarrojado
Copy link

@dominicarrojado Maybe CI cache?

Yes, you're right. That was the issue and apparently GitHub doesn't allow manual purge so I disabled the caching first and it finally build successfully. Thanks!

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

Successfully merging a pull request may close this issue.

5 participants