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.

<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies

See original GitHub issue

What version of Next.js are you using?

11.0.1

What version of Node.js are you using?

14.17.3

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying your application?

Not deployed yet

Describe the Bug

Simply creating a new Next.js project and running yarn dev / npm run dev logs the following warning in the console:

<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies

I have tried deleting yarn.lock, and running yarn install again , but that did not do anything.

I’m not sure if this is related but, when first creating the project, I also get the following warnings:

image

Expected Behavior

No warning, or an explanation of the warning.

To Reproduce

  1. yarn create next-app or npx create-next-app
  2. Finish the setup
  3. yarn dev or npm run start

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
Fangston0commented, Aug 6, 2021

Hi @sokra Could you have a look at the above log and help me figure out what’s wrong? All I can understand is that some package is missing, but I am not sure how to fix that. Any help would be appreciated, thank you!

1reaction
sokracommented, Aug 3, 2021

Some kind of error happened… You need to enable debug logging to see the error:

// next.config.js
module.exports = {
  webpack(config) {
    config.infrastructureLogging = { debug: /PackFileCache/ }
    return config;
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

<w> [webpack.cache.PackFileCacheStrategy] Caching failed ...
cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies · Ask Question. Asked 4 months ago.
Read more >
[Solved] Message 'Caching failed for pack: Error: Unable to ...
virginie chaix Asks: Message 'Caching failed for pack: Error: Unable to snapshot resolve dependencies' when creating a nextjs application
Read more >
Caching - webpack
This guide focuses on the configuration needed to ensure files produced by webpack compilation can remain cached unless their content has changed. Output ......
Read more >
webpack/webpack - Gitter
However I see the following warning: <w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: ENOENT: no such file or directory, ...
Read more >
[Solved]-Message 'Caching failed for pack: Error
[Solved]-Message 'Caching failed for pack: Error: Unable to snapshot resolve dependencies' when creating a nextjs application-node.js. Search. score:0.
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