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

parcel watch error: Expected content key 2d39cdf7c618ab5b to exist #8874

Open
ted-palmer opened this issue Mar 10, 2023 · 31 comments
Open

parcel watch error: Expected content key 2d39cdf7c618ab5b to exist #8874

ted-palmer opened this issue Mar 10, 2023 · 31 comments
Labels

Comments

@ted-palmer
Copy link

ted-palmer commented Mar 10, 2023

🐛 bug report

When running parcel watch 'packages/*' --no-cache I'm getting the following errors:

Error: Expected content key 2d39cdf7c618ab5b to exist
    at nullthrows (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/nullthrows/nullthrows.js:7:15)
    at ContentGraph.getNodeIdByContentKey (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/graph/lib/ContentGraph.js:81:38)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/BundleGraph.js:746:30)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/public/BundleGraph.js:145:24)
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:17188:54
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33551:34
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._runFn (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33579:19)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._next (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33572:20)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039.run (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33567:81)
    at $7728b866c345490a$export$2e2bcd8739ae039.emitUpdate (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:17210:34) {
  framesToPop: 1
}
Error: Expected content key 2d39cdf7c618ab5b to exist
    at nullthrows (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/nullthrows/nullthrows.js:7:15)
    at ContentGraph.getNodeIdByContentKey (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/graph/lib/ContentGraph.js:81:38)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/BundleGraph.js:746:30)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/public/BundleGraph.js:145:24)
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:17188:54
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33551:34
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._runFn (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33579:19)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._next (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33572:20)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039.run (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33567:81)
    at $7728b866c345490a$export$2e2bcd8739ae039.emitUpdate (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:17210:34) {
  framesToPop: 1
}
Error: Expected content key 2b62a9a42f419169 to exist
    at nullthrows (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/nullthrows/nullthrows.js:7:15)
    at ContentGraph.getNodeIdByContentKey (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/graph/lib/ContentGraph.js:81:38)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/BundleGraph.js:746:30)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/public/BundleGraph.js:145:24)
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:17188:54
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33551:34
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._runFn (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33579:19)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._next (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33572:20)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039.run (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33567:81)
    at $7728b866c345490a$export$2e2bcd8739ae039.emitUpdate (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:17210:34) {
  framesToPop: 1
}
Error: Expected content key a628082bff6583f1 to exist
    at nullthrows (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/nullthrows/nullthrows.js:7:15)
    at ContentGraph.getNodeIdByContentKey (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/graph/lib/ContentGraph.js:81:38)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/BundleGraph.js:746:30)
    at BundleGraph.getDependencies (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/core/lib/public/BundleGraph.js:145:24)
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:17188:54
    at /Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33551:34
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._runFn (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33579:19)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._next (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33572:20)
    at $b0fd219fea43bcac$export$2e2bcd8739ae039._next (/Users/tedpalmer/Desktop/reservoir-kit/node_modules/@parcel/utils/lib/index.js:33573:38)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  framesToPop: 1
✨ Built in 6.89s

Running parcel build 'packages/*' --no-cache builds fine with no errors.

Downgrading to parcel 2.8.2 didn't fix this, as suggested in #8787

Deleting .parcel-cache also didn't work.

🎛 Configuration (.babelrc, package.json, cli command)

{
  "devDependencies": {
    "@parcel/optimizer-data-url": "2.8.2",
    "@parcel/packager-ts": "2.8.2",
    "@parcel/transformer-inline-string": "2.8.2",
    "@parcel/transformer-typescript-tsc": "2.8.2",
    "@parcel/transformer-typescript-types": "2.8.2",
    "@types/node": "^17.0.10",
    "@types/react": "^18.0.15",
    "@types/react-dom": "^18.0.6",
    "buffer": "^6.0.3",
    "ethers": "^5.6.9",
    "gitlog": "^4.0.4",
    "parcel": "2.8.2",
    "prettier": "^2.5.1",
    "process": "^0.11.10",
    "replace-in-files": "^3.0.0",
    "typescript": "^4.9.4"
  },
}

🤔 Expected Behavior

Running parcel watch 'packages/*' --no-cache should build with no errors, just as parcel build 'packages/*' --no-cache does.

😯 Current Behavior

Seeing the errors mentioned above.

💁 Possible Solution

Update: adding the --no-hmr parameter to parcel watch made the errors go away

🔦 Context

💻 Code Sample

Here is the repo where I am running into this issue:
https://github.com/reservoirprotocol/reservoir-kit/tree/ted/upgrade-typescript-solution

🌍 Your Environment

Software Version(s)
Parcel 2.8.3 and 2.8.2
Node
npm/Yarn
Operating System macOS Ventura 13.1
@ted-palmer ted-palmer changed the title Error: Expected content key 2d39cdf7c618ab5b to exist parcel watch error: Expected content key 2d39cdf7c618ab5b to exist Mar 12, 2023
@cyrusdean
Copy link

cyrusdean commented Mar 19, 2023

I'm also experiencing this issue, but it's also on my build. At first I noticed it when building my Docker image but not locally. After clearing my package-lock and installing the latest version it began happening locally as well.

I've also tried 2.8.2 and same result.

When I tried to revert back to the version I was using, 2.7.0, I started getting a new error:

@parcel/workers: Expected constructor 2.7.0:BundleGraph to be registered with serializer to deserialize

I've yet to find a way around this issue.

EDIT:

Just now found a way around it. I reverted to 2.7.0 again and found where the error in reverting before was. I hadn't explicitly installed @parcel/core at 2.7.0. Adding that to the dependencies, matching parcel and @parcel/transformer-sass my build functions again.

@ted-palmer
Copy link
Author

ted-palmer commented Mar 19, 2023

Update: I also hadn't explicitly installed @parcel/core, however, that didn't fix the issue for me. After a lot of testing I discovered that adding the --no-hmr parameter to parcel watch made the errors go away

@vinayadiga7
Copy link

For me it worked when I deleted the .parcel-cache and dist folders completely in the root directory and did the rebuild.

@rcramh
Copy link

rcramh commented Jun 11, 2023

delete the .parcel-cache folder, then try running command again, it'll work.

@nitukumari34
Copy link

error: Expected content key de1e4a02ec63c4eb to exist
This error occurs in parcel version 2.9.2 .
then I downgrade the parcel version into 2.7.0 and then error resolved .

@taofeek-ob
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

This fixed it for me.

@akanandhu
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

This worked for me

@Harshitbansal637
Copy link

Same error occurred to me in parcel version - 2.9.3
Solution that worked for me - clear the parcel cache (rm -rf .parcel-cache) and run the application again.

@rajatrawal
Copy link

then

this worked for me

@NiteshJ1998
Copy link

NiteshJ1998 commented Jul 24, 2023

delete the .parcel-cache folder, then try running command again, it'll work.

This worked for me . Thank you

@nitrathod
Copy link

I just deleted the .parcel-cache and dist folders completely from the root directory and rebuild the applicate, it did worked for me

@RuquiaAlam
Copy link

error: Expected content key de1e4a02ec63c4eb to exist This error occurs in parcel version 2.9.2 . then I downgrade the parcel version into 2.7.0 and then error resolved .

this helped me..thanks

@thedevbek
Copy link

Thanks, I deleted both the dist and cache, and now it works. It accidentally deleted the dist first so you probably won't have to. But thanks for the solution. I haven't worked with a dist before so appreciate your post.

@Subha8371
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

its working✨

@Rashid004
Copy link

Error: Expected content key de1e4a02ec63c4eb to exist

Error: Expected content key de1e4a02ec63c4eb to exist
at nullthrows (C:\Users\Ansari Rashid\Desktop\starter\node_modules\nullthrows\nullthrows.js:7:15)
at AssetGraph.getNodeIdByContentKey (C:\Users\Ansari
Rashid\Desktop\starter\node_modules@parcel\graph\lib\ContentGraph.js:67:38)
at C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\SymbolPropagation.js:52:82
at Array.map ()
at propagateSymbols (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\SymbolPropagation.js:52:61)
at AssetGraphBuilder.build (C:\Users\Ansari
Rashid\Desktop\starter\node_modules@parcel\core\lib\requests\AssetGraphRequest.js:168:62)
at async Object.run (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\requests\AssetGraphRequest.js:60:37)
at async RequestTracker.runRequest (C:\Users\Ansari
Rashid\Desktop\starter\node_modules@parcel\core\lib\RequestTracker.js:633:20)
at async Object.run (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\requests\BundleGraphRequest.js:103:11)
at async RequestTracker.runRequest (C:\Users\Ansari
Rashid\Desktop\starter\node_modules@parcel\core\lib\RequestTracker.js:633:20)

@ColloKaris
Copy link

This worked for me. Thank you

@KeshavTandon
Copy link

Error: Expected content key de1e4a02ec63c4eb to exist

Error: Expected content key de1e4a02ec63c4eb to exist at nullthrows (C:\Users\Ansari Rashid\Desktop\starter\node_modules\nullthrows\nullthrows.js:7:15) at AssetGraph.getNodeIdByContentKey (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\graph\lib\ContentGraph.js:67:38) at C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\SymbolPropagation.js:52:82 at Array.map () at propagateSymbols (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\SymbolPropagation.js:52:61) at AssetGraphBuilder.build (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\requests\AssetGraphRequest.js:168:62) at async Object.run (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\requests\AssetGraphRequest.js:60:37) at async RequestTracker.runRequest (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\RequestTracker.js:633:20) at async Object.run (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\requests\BundleGraphRequest.js:103:11) at async RequestTracker.runRequest (C:\Users\Ansari Rashid\Desktop\starter\node_modules@parcel\core\lib\RequestTracker.js:633:20)

I am getting the same error

@Steve-1993
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

This worked for me too. Thank you

@jason-murray
Copy link

Deleting .parcel-cache works for me until I change the HTML node structure in any way, then the problem returns. I'm changing elements all the time so this fix isn't really valid for me. Anyone else got this?

@AkashBharti97
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

It work for me .

@JINESH-742203970
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

Yeah,after deleting .parcel-cache folder and run command again .It's working for me

@Rashid004
Copy link

Nice

@ARyaskov
Copy link

Right, deleting of .parcel-cache did a trick.
If you are using monorepos pls delete a top-level .parcel-cache, not into /packages/your-package/.

@netrunner2
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

Yep, this did it for me as well!

@0xchikku
Copy link

For me it worked when I deleted the .parcel-cache and dist folders completely in the root directory and did the rebuild.

Worked for me, using parcel version 2.10.3

@Revathi-80
Copy link

folder

yes deleting .parcel-cache worked for me

@priyanshukumar001
Copy link

after closing the server and
then deleting the .parcel-cache file and
again executing npx parcel

solved the problem!

@aakash-01-1996
Copy link

Step 1. Stop the Server (ctrl + c)
Step 2. Delete .parcel-cache folder
Step 3. npx parcel index.html

Problem solved!🤝

@DerekGray2022
Copy link

delete the .parcel-cache folder, then try running command again, it'll work.

Stopping the server running then doing this worked for me.

@r-rayns
Copy link

r-rayns commented Feb 23, 2024

Deleting .parcel-cache works for me until I change the HTML node structure in any way, then the problem returns. I'm changing elements all the time so this fix isn't really valid for me. Anyone else got this?

This is what I'm experiencing too. I can edit one of my JavaScript files over and over without this error occurring. I can even edit inside a <script> tag inside a .html document without issue. As soon as I start editing my HTML markup I get this error and have to restart parcel.

@pandeyvimal-03
Copy link

delete parcel-cache and dist folder then restart your using npx parcel index.html

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

No branches or pull requests