Parcel Build Error: Error: Key 216aea59fec25090 not found in cache/Error: Got unexpected null at nullthrows
Asked Answered
S

6

5

So I'm a total beginner. I am building a web client with react. I am using parcel to build it and bundle it. I am doing this via the Career Foundry boot camp.

I got this error, and I don't know how to fix it.

Error: Key 216aea59fec25090 not found in cache

  Error: Key 216aea59fec25090 not found in cache
      at LMDBCache.getBlob 
  (/Users/jxxxxxxxxx/.nvm/versions/node/v16.16.0/lib/node_modules/parcel/node_modules/@parcel/cache/lib/LMDBCache.js:130:70)
      at Object.run 
  (/Users/jxxxxxxxxxxx/.nvm/versions/node/v16.16.0/lib/node_modules/parcel/node_modules/@parcel/core/lib/requests/WriteBundleRequest.js:165:68)
      at async RequestTracker.runRequest 
  (/Users/jxxxxxxxxxxxx/.nvm/versions/node/v16.16.0/lib/node_modules/parcel/node_modules/@parcel/core/lib/RequestTracker.js:756:20)

I tried searching online to see how to fix the build, but I found nothing. I tried doing some editing to my code to see if some things would change.

Now I am getting this error:

Error: Got unexpected null

  Error: Got unexpected null
      at nullthrows 
  (/Users/jxxxxxxxxxxxx/.nvm/versions/node/v16.16.0/lib/node_modules/parcel/node_modules/nullthrows/nullthrows.js:7:15)
      at loadConfig 
  (/Users/jxxxxxxxxxxxx/.nvm/versions/node/v16.16.0/lib/node_modules/parcel/node_modules/@parcel/core/lib/worker.js:116:51)
      at async Object.runTransform 
  (/Users/jxxxxxxxxxxxx/.nvm/versions/node/v16.16.0/lib/node_modules/parcel/node_modules/@parcel/core/lib/worker.js:135:16)


What is an "unexpected null"? How do you fix this? Should I re-initialize the node modules via npm init? What can I do in terminal to get my build to work again for this client/app.

I would love to be able to fix whatever is wrong with parcel/node_modules and not have to start all over with my client/app.

Sunroom answered 29/11, 2022 at 4:14 Comment(1)
Please provide enough code so others can better understand or reproduce the problem.Whirlwind
S
7

I ran into this exact same cache error, and it turned out that Parcel seemingly can't create the cache if it can't find Python.

After ensuring python was correctly added to my path, updating Parcel, and deleting the .parcel-cache folder, it built successfully.

Spinnaker answered 8/4, 2023 at 1:31 Comment(0)
T
4

You can just delete .parcel-cache folder and now you can run build command.

Its totally safe to delete .parcel-cache folder

Tribe answered 16/7, 2023 at 14:10 Comment(0)
M
2

First stop the program ,then delete " .parcel-cache " folder. And then start the program again. It fixed the error in my case. Thanks

Marseillaise answered 24/3, 2023 at 15:51 Comment(1)
Instead of simply providing the answer directly, try writing a detailed comment that explains the solution, as long as the explanation is not too lengthy.Palette
T
0

I ran into this exact same cache error, and it turned out that Parcel seemingly can't create the cache if it can't find when i was working on project.

  1. You have to first stops the execution of program by ctrl + c.
  2. then you have to delete the .parcel-cache from the project.
  3. then build the project. npx parcel index.html
Tallou answered 5/6, 2023 at 11:11 Comment(0)
H
0

Error : [Error: Key 216aea59fec25090 not found in cache] is a content caching issue related to parcel. Delete folder .parcel-cache once deleted then re-run <npx parcel "your file"> Hope it helps.

Harts answered 10/6, 2023 at 6:22 Comment(0)
C
0

Don't worry, it's not a serious issue, and can be fixed easily:

  1. Delete the .parcel-cache folder.
    This folder contains only auto generated files that are safe to delete. Just don't touch other files - as it's a cache issue, just delete the cache.
  2. Run your build command, e.g. npm run build (This will auto-(re)generate the necessary files)
  3. Run your start command, e.g. npm run start
Crowther answered 30/1 at 16:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.