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

"Error: Does not have node" when importing assets and using module/nomodule pattern #5985

Open
typeofweb opened this issue Mar 11, 2021 · 34 comments · Fixed by #7869
Open

"Error: Does not have node" when importing assets and using module/nomodule pattern #5985

typeofweb opened this issue Mar 11, 2021 · 34 comments · Fixed by #7869

Comments

@typeofweb
Copy link

typeofweb commented Mar 11, 2021

It's almost an empty project with antdesign and typescript.
Builds fine when --no-scope-hoist is used.

error output
parcel build ./src/index.html --dist-dir ../dist/client "--log-level" "verbose"

⠋ Building context.js...
Error: Does not have node eb7284955c6b0a677c6f6259e9c71f61
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 1566be9d916265373ec08f879521abf6
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 017c8302f520a2da37b7b761360a22ca
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 543a4c8efc7c7aefd3c434bc4bc820f5
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 1672f00ec0743667363a84aa031fcbfe
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node b18347399b31ad52341407d3b028d2db
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node c470e2256ce222263b9fbe9cdea6734a
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 93a5ff44ab9625cd2d7e10e95b19fa1b
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 6ed5d95187be657a2552f6faee478e5d
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 6ef387e49a8235392de2f6f65b568bab
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 22dd39892fea5467e1b22a0b583af1b8
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 5a9dc1c8cea032014c56033f97ec03d5
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node c1d76a078ba76b28b7d3799542e430d7
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node c08f8e50102228ece207ea349e465762
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node a8b60b7c935263642dbec6f9b3611d3a
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 494c97bd535c41d845947208ad7f6ae7
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 20ea176fa80700456162bcd06e9ecae0
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 3fab4b6c30e9d24a7029bc03fa49341f
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 7a413cc5fdb411f011fe2af3a0b6a864
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node ddde4e9799c72e10b98b53fc0701ef84
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
package.json
{
  "name": "project",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "build:client": "cd ./client && parcel build ./src/index.html --dist-dir ../dist/client",
    "postinstall": "husky install"
  },
  "devDependencies": {
    "@babel/preset-typescript": "7.13.0",
    "@parcel/babel-plugin-transform-runtime": "2.0.0-nightly.2247",
    "@parcel/transformer-less": "2.0.0-nightly.625",
    "@parcel/transformer-postcss": "2.0.0-nightly.625",
    "@testing-library/jest-dom": "5.11.9",
    "@testing-library/react": "11.2.5",
    "@testing-library/user-event": "12.8.3",
    "@types/body-parser": "1.19.0",
    "@types/express": "4.17.11",
    "@types/jest": "26.0.20",
    "@types/node": "14.14.33",
    "@types/react": "17.0.3",
    "@types/react-dom": "17.0.2",
    "@types/react-router-dom": "5.1.7",
    "@types/stoppable": "1.1.0",
    "@typescript-eslint/eslint-plugin": "4.17.0",
    "@typescript-eslint/parser": "4.17.0",
    "babel-plugin-import": "1.13.3",
    "concurrently": "6.0.0",
    "eslint": "7.21.0",
    "eslint-config-react-app": "6.0.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jest": "24.2.1",
    "eslint-plugin-jsx-a11y": "6.4.1",
    "eslint-plugin-react": "7.22.0",
    "eslint-plugin-react-hooks": "4.2.0",
    "eslint-plugin-testing-library": "3.10.1",
    "husky": "5.1.3",
    "identity-obj-proxy": "3.0.0",
    "jest": "26.6.3",
    "lint-staged": "10.5.4",
    "parcel": "2.0.0-nightly.623",
    "postcss": "8.2.8",
    "postcss-modules": "4.0.0",
    "prettier": "2.2.1",
    "ts-jest": "26.5.3",
    "ts-node-dev": "1.1.6",
    "typescript": "4.2.3",
    "typescript-plugin-css-modules": "3.2.0"
  },
  "dependencies": {
    "antd": "4.13.1",
    "axios": "0.21.1",
    "body-parser": "1.19.0",
    "clsx": "1.1.1",
    "dotenv": "8.2.0",
    "express": "4.17.1",
    "helmet": "4.4.1",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-query": "3.12.1",
    "react-router-dom": "5.2.0",
    "stoppable": "1.1.0",
    "web-vitals": "1.1.0"
  },
  "engines": {
    "node": "14.x.x",
    "npm": "7.x.x"
  },
  "alias": {
    "shared": "./shared"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
.babelrc
{
  "presets": [
    "@parcel/babel-preset-env",
    "@babel/preset-typescript",
    ["@babel/preset-react", { "runtime": "automatic" }]
  ],
  "plugins": [
    "@babel/plugin-transform-typescript",
    "@parcel/babel-plugin-transform-runtime",
    [
      "import",
      {
        "libraryName": "antd",
        "libraryDirectory": "es",
        "style": false
      }
    ]
  ]
}

🤔 Expected Behavior

The project builds with scope hoisting.

😯 Current Behavior

Error.

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-nightly.623+7eb2b163
Node v14.15.5
npm/Yarn 7.5.4
Operating System macOS 11.2.3 (20D91)
@mischnic
Copy link
Member

mischnic commented Mar 11, 2021

It's almost an empty project with antdesign and typescript.

Can you share a reproduction?

@typeofweb
Copy link
Author

Sorry, I cannot reproduce it in a new project :| There's something funky going on. Sometimes it even throws a v8 error…

Error: Does not have node d4a4db5e41321ee9d0e802780f73e47b
    at assertHasNode (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/project/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: 0x1012d96a5 node::Abort() (.cold.1) [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 2: 0x1000a6309 node::Abort() [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 3: 0x1000a646f node::OnFatalError(char const*, char const*) [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 4: 0x1001eaea0 v8::V8::ToLocalEmpty() [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 5: 0x1000a13cf node::fs::FSReqPromise<node::AliasedBufferBase<double, v8::Float64Array, void> >::Resolve(v8::Local<v8::Value>) [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 6: 0x1000ab60b node::fs::AfterInteger(uv_fs_s*) [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 7: 0x1009e7c38 uv__work_done [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 8: 0x1009eccdb uv__async_io [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
 9: 0x100a00aac uv__io_poll [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
10: 0x1009ed261 uv_run [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
11: 0x1001423a2 node::worker::Worker::Run() [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
12: 0x100145952 node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) [/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-7556272/bin/node]
13: 0x7fff20521950 _pthread_start [/usr/lib/system/libsystem_pthread.dylib]
14: 0x7fff2051d47b thread_start [/usr/lib/system/libsystem_pthread.dylib]
sh: line 1: 37103 Abort trap: 6           NODE_OPTIONS=--max_old_space_size=4096 parcel build ./src/index.html --dist-dir ../dist/client
npm ERR! code 134
npm ERR! path /Users/typeofweb/project
npm ERR! command failed
npm ERR! command sh -c rm -rf ./.parcel-cache ./dist/client && cd ./client && NODE_OPTIONS=--max_old_space_size=4096 parcel build ./src/index.html --dist-dir ../dist/client
[build:client]
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/typeofweb/.npm/_logs/2021-03-11T16_37_08_718Z-debug.log
npm run build:client exited with code 134

@typeofweb
Copy link
Author

Sometimes it builds (not sure what's the causality). But even then the app fails to work because of a runtime error:

index.0728b35e.js:532 Uncaught ReferenceError: $35daae230e74d697028ddb53639ef6f2$exports is not defined
    at index.0728b35e.js:532

@mischnic
Copy link
Member

Could this be because you upgraded Parcel? Maybe try deleting .parcel-cache

@typeofweb
Copy link
Author

Now I tried removing .parcel-cache before every build but that didn't change anything.

@mischnic
Copy link
Member

There's not much we can do without a reproduction...

Maybe you can somehow remove all closed source code from that "empty project with antdesign and typescript" whlie still retaining the file structure?

@typeofweb
Copy link
Author

I managed to create a reproduction with just a single .tsx file: https://github.com/mmiszy/parcel-problem-reproduction

Build with npm run build:client.

npm run build:client

> reproduction@0.0.1 build:client
> npm run clean:client && cd ./client && parcel build ./src/index.html --dist-dir ../dist/client


> reproduction@0.0.1 clean:client
> rm -rf ./.parcel-cache && rm -rf ./dist/client

⠇ Building index.js...
Error: Does not have node f49d428e13de5b4c24be5f771db2a01c
    at assertHasNode (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 736940802bbb410d3b8dc038d635bf80
    at assertHasNode (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 95c8c3bded3b1551416e9e83e36a70ac
    at assertHasNode (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node a7495127d9a606bf52821d12bc706eea
    at assertHasNode (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node e1672cbf04261b03edf44662b2d89c49
    at assertHasNode (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:231:65
Error: Does not have node 493ce624f40ad6ea979338ce9f7b4a27
    at assertHasNode (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:583:11)
    at AssetGraph.getNodesConnectedFrom (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/Graph.js:181:5)
    at visitChildren (/Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:236:41)
    at /Users/typeofweb/reproduction/node_modules/@parcel/core/lib/requests/AssetGraphRequest.
⠏ Building index.js...
npm ERR! code 1
npm ERR! path /Users/typeofweb/reproduction
npm ERR! command failed
npm ERR! command sh -c npm run clean:client && cd ./client && parcel build ./src/index.html --dist-dir ../dist/client

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/typeofweb/.npm/_logs/2021-03-15T14_33_24_453Z-debug.log

Log:

0 verbose cli [
0 verbose cli   '/Users/typeofweb/.fnm/node-versions/v14.15.5/installation/bin/node',
0 verbose cli   '/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-59222/bin/npm',
0 verbose cli   'run',
0 verbose cli   'build:client'
0 verbose cli ]
1 info using npm@7.5.4
2 info using node@v14.15.5
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/Users/typeofweb/.fnm/node-versions/v14.15.5/installation/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 2ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/Users/typeofweb/reproduction/.npmrc Completed in 1ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/typeofweb/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/Users/typeofweb/.fnm/node-versions/v14.15.5/installation/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 2ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 9ms
19 verbose npm-session 757eb20c4cea8e99
20 timing npm:load Completed in 15ms
21 timing command:run-script Completed in 13558ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/Users/typeofweb/.fnm/node-versions/v14.15.5/installation/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (events.js:315:20)
22 verbose stack     at maybeClose (internal/child_process.js:1048:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
23 verbose pkgid reproduction@0.0.1
24 verbose cwd /Users/typeofweb/reproduction
25 verbose Darwin 20.3.0
26 verbose argv "/Users/typeofweb/.fnm/node-versions/v14.15.5/installation/bin/node" "/var/folders/1k/m97qqp8933q79hxgrgs3s6c80000gn/T/fnm-shell-59222/bin/npm" "run" "build:client"
27 verbose node v14.15.5
28 verbose npm  v7.5.4
29 error code 1
30 error path /Users/typeofweb/reproduction
31 error command failed
32 error command sh -c npm run clean:client && cd ./client && parcel build ./src/index.html --dist-dir ../dist/client
33 verbose exit 1

@typeofweb
Copy link
Author

Looks like it's a problem with fonts. If I remove @font-face declarations, the build works fine. @mischnic

@typeofweb
Copy link
Author

This is only a problem when module/nomodule pattern is used:

    <script nomodule src="./index.js"></script>
    <script type="module" src="./index.js"></script>

Removing either of the lines fixes it.

@typeofweb typeofweb changed the title Error: Does not have node … in @parcel/core/lib/Graph.js "Error: Does not have node" when importing assets and using module/nomodule pattern Mar 17, 2021
@hallsbyra
Copy link
Contributor

I see this problem too. Getting sporadic Error: Does not have node when building. Observations:

  • Running on a VM with 8 CPUs I almost never get the problem.
  • Running the same build on a 1 CPU machine I always get the problem. So it seems to be a timing issue.
  • Using --no-scope-hoist removes the problem. (But causes other --no-scope-hoist breaks IE11 compatibility #6767)

@mischnic
Copy link
Member

mischnic commented Dec 2, 2021

Is this still a problem?

@danieltroger
Copy link
Contributor

I just got it in a project using @parcel/css. Along with Error: Expected content key 7f72eeba937b8af7 to exist.

Don't know if it has to do with module/nomodule or @parcel/css.

Will debug more later and try to make a reproduction.

Error log

⠴ Building arrayWithHoles.js...
Error: Does not have node 9280
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9281
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9282
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9283
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9285
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9284
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9288
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9286
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9287
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9291
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9289
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9293
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9290
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9294
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9292
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9297
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9296
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9295
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9298
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Does not have node 9299
    at AssetGraph._assertHasNodeId ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
    at [project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
🚨 Build failed.

Error: Expected content key 7f72eeba937b8af7 to exist

  Error: Expected content key 7f72eeba937b8af7 to exist
  at nullthrows ([project_dir]/app/.yarn/cache/nullthrows-npm-1.1.1-3d1f817134-10806b9212.zip/node_modules/nullthrows/nullthrows.js:7:15)
  at AssetGraph.getNodeIdByContentKey ([project_dir]/app/.yarn/cache/@parcel-graph-npm-2.2.2-nightly.2609-f655ee38c1-79a80575d0.zip/node_modules/@parcel/graph/lib/ContentGraph.js:81:38)
  at AssetGraph.resolveDependency ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/AssetGraph.js:272:26)
  at AssetGraphBuilder.runPathRequest ([project_dir]/app/.yarn/cache/@parcel-core-npm-2.0.0-nightly.984-66d6e43b73-572f7d6dbb.zip/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:768:21)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async PromiseQueue._runFn ([project_dir]/app/.yarn/cache/@parcel-utils-npm-2.0.0-nightly.986-40ac3af7cf-ffb4d7392a.zip/node_modules/@parcel/utils/lib/PromiseQueue.js:88:7)
  at async PromiseQueue._next ([project_dir]/app/.yarn/cache/@parcel-utils-npm-2.0.0-nightly.986-40ac3af7cf-ffb4d7392a.zip/node_modules/@parcel/utils/lib/PromiseQueue.js:75:5)

@danieltroger
Copy link
Contributor

Think I encountered the issue by changing parcel version and not removing .parcel-cache. I deleted the cache once and had it happen again, deleted the cache again and now it doesn't happen anymore.

@jhillyerd
Copy link

jhillyerd commented Mar 24, 2022

I am also seeing this problem, even after removing the cache.

yarn run parcel --version
yarn run v1.22.17
$ /home/james/devel/inbucket/ui/node_modules/.bin/parcel --version
2.4.0

Each time I run yarn build I get different "Does not have node" output, most often while building a woff2 or _class_call_check.js. I wasn't seeing this a few weeks ago, but I think my distro may have upgraded me from nodejs 14 to nodejs 16.

@danieltroger
Copy link
Contributor

@jhillyerd parcel v1 is ancient, try upgrading to v2

@jhillyerd
Copy link

It's running parcel 2.4.0, I think the first line is the yarn version.

@danieltroger
Copy link
Contributor

Sorry, I'm stupid

@aldrakos
Copy link

Also seeing this problem just after upgrading to parcel 2.4.0 (using node 16.13.0)
Fails either with customs fonts and @font-face (is scss file) or with SVG icons (inline via ChakraUI library).

Have cleared parcel-cache, node_modules, and all temp files.
Dev with npm start works just fine. On build getting these errors sometimes at different places:

Error: Does not have node xxxx
 at AssetGraph._assertHasNodeId ([path]\node_modules\@parcel\graph\lib\Graph.js:397:13)
    at AssetGraph.getNodeIdsConnectedFrom ([path]\node_modules\@parcel\graph\lib\Graph.js:113:10)
    at visitChildren ([path]\node_modules\@parcel\core\lib\requests\AssetGraphRequest.js:162:47)
    at [path]\node_modules\@parcel\core\lib\requests\AssetGraphRequest.js:157:67
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Some times re-running the build process mysteriously works (without any changes at all).

@devongovett devongovett self-assigned this Mar 24, 2022
@devongovett
Copy link
Member

Working on this one

@cipherlogs
Copy link

Still getting the same error

@parcel/bundler-default: Expected content key 3c3c4abfc43a134d to exist

and my project is empty, just installed tailwind nothing else !!

@Soecka
Copy link

Soecka commented Jan 10, 2023

Looks like it's a problem with fonts. If I remove @font-face declarations, the build works fine. @mischnic

When I imported the @fontface with a less file, parcel reports the same error
, so I tried to import the declarations with a css file and it works

  • parcel version 2.7

> parcel build src/index.html --public-url .
--
23:04:16.705 |  
23:04:17.383 | Building...
23:04:21.592 | Error: Does not have node 4582
23:04:21.593 | at AssetGraph._assertHasNodeId (/vercel/path0/node_modules/.pnpm/@parcel+graph@2.7.0/node_modules/@parcel/graph/lib/Graph.js:403:13)
23:04:21.593 | at AssetGraph.getNodeIdsConnectedFrom (/vercel/path0/node_modules/.pnpm/@parcel+graph@2.7.0/node_modules/@parcel/graph/lib/Graph.js:113:10)
23:04:21.593 | at visitChildren (/vercel/path0/node_modules/.pnpm/@parcel+core@2.7.0/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
23:04:21.593 | at /vercel/path0/node_modules/.pnpm/@parcel+core@2.7.0/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
23:04:21.594 | Error: Does not have node 4583
23:04:21.594 | at AssetGraph._assertHasNodeId (/vercel/path0/node_modules/.pnpm/@parcel+graph@2.7.0/node_modules/@parcel/graph/lib/Graph.js:403:13)
23:04:21.594 | at AssetGraph.getNodeIdsConnectedFrom (/vercel/path0/node_modules/.pnpm/@parcel+graph@2.7.0/node_modules/@parcel/graph/lib/Graph.js:113:10)
23:04:21.594 | at visitChildren (/vercel/path0/node_modules/.pnpm/@parcel+core@2.7.0/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:162:47)
23:04:21.594 | at /vercel/path0/node_modules/.pnpm/@parcel+core@2.7.0/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:157:67
23:04:21.737 | ELIFECYCLE  Command failed with exit code 1.

@S-unya
Copy link

S-unya commented Jan 25, 2023

I get this issue having upgraded to parcel v2.8.3 (it also occurs in v2.7.0). I have deleted .parcel-cache. This error occurs intermittently on my local machine (Mac M1) with a 1 in 2 frquency.

I have no occurrence of @font-face in the project, but plenty of svg files (as per @aldrakos ' mention). We also use the import * as Context from "./context" pattern, but removing this doesn't appear to affect the frequency of errors.

$ yarn build
yarn run v1.19.0
warning package.json: No license field
$ parcel build --no-cache --log-level error && node ./buildTasks/sassTasks.js && yarn check-types
Error: Does not have node 2555
    at AssetGraph._assertHasNodeId (/project/node_modules/@parcel/graph/lib/Graph.js:411:13)
    at AssetGraph.getNodeIdsConnectedFrom (/project/node_modules/@parcel/graph/lib/Graph.js:113:10)
    at visitChildren (/project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:170:47)
    at /project/node_modules/@parcel/core/lib/requests/AssetGraphRequest.js:165:67
error Command failed with exit code 1.

In order to fix this I have had to downgrade to parcel v2.6.2, which also locks us on typescript ~4.6 due to this bug.

FWIW I don't believe this issue is fixed.

@mischnic
Copy link
Member

@Soecka @S-unya Can you share a reproduction?

@S-unya
Copy link

S-unya commented Jan 25, 2023

For your information, I was not entirely correct about the downgrade to v2.6.2 fixing the issue; locally it builds every time, but on Github actions it still fails. Given this I wonder if there is something else at play here.

@mischnic I will try to make a minimal reproduction of the issue 👍

@S-unya
Copy link

S-unya commented Jan 25, 2023

I've made a minimal version of my application that just imports the svg, uses the latest typescript and parcel and it all build fine. I'm going to play around over the next few weeks to see if I can work out which particular combination of factors results in this.

@S-unya
Copy link

S-unya commented Jan 25, 2023

@mischnic I have been able to identify that the build fails based on how much parcel is doing, but a minimal reproduction does not seem to be feasible.

This was my process:

At the root of my package src files is a barrel file of this pattern:

import { MyThing } from "./folder/MyThing";
// many more imports

export {
   // many exports
   MyThing,
   // many more exports
};

I experimented with removing all imports and exports, using various algorythms to re-add the import/export pairs. I noticed that the build became more and more unreliable after the 50 mark (I tried this 3 different times with the same outcome).

I also tried leaving all imports but removing all the parameters in the export object (bar 1) and the build was again unreliable. Commenting out the imports made the build reliable again.

I tried to make a minimal reproduction with a really simple component repeated 340 times in a barrel file, but parcel handles this pretty easily and outpts a transpiled js file of about the same size as my actual project. So I think the very concept of a simple reproduction here is not viable. 🤷

I'd be happy to try out any other debugging if you can recommend a way...

@S-unya
Copy link

S-unya commented Jan 27, 2023

OK @mischnic , I think that I now know what is causing my issue, but I can't claim to understand why. I believe that there are essentially 2 issues.

The first issue only occurs when the output files are set to the configuration below. I spent some time trying to analyse which of my files were causing issues during build. I could safely build all my svg icons directly and most of my normal react components, but the components that imported svg icons seemed to intermittently cause the build to fail. This was very hard to debug due to the intermittent nature. I think there is genuinely a problem here, but I have been unable to reproduce the issue outside of this project.

Issue 2 seems to be the root cause. It occurred to me that when I rolled back my parcel upgrade, that I was still experiencing the same problem, so I reviewed other changes I made at the same time and discovered that I had also changed the output to match the docs and reflect my actual output.

This pacakge.json configuration causes the intermittent build failures above (but looks right and matches the documentation here):

    "source": [
        "src/index.ts"
    ],
    "main": "build/index.umd.cjs",
    "module": "build/index.js",
    "types": "build/types.d.ts",
    "files": [
        "build"
    ],
    "exports": {
        ".": {
            "import": "./build/index.js",
            "require": "./build/index.umd.cjs"
        }
    },

When I reverted back to this, the build failures ceased, but it doesn't reflect my needs:

   "source": [
        "src/index.ts"
    ],
    "main": "build/index.umd.cjs",
    "module": "build/index.js",
    "browser": "build/index.js",
    "types": "build/types.d.ts",
    "targets": {
        "main": false,
        "module": false
    },
    "files": [
        "build"
    ],

Equally, I can get this to work, but it doesn't output the ES module file, rather it outputs a file called index.js, but it looks like a cjs file.

   "source": [
        "src/index.ts"
    ],
    "main": "build/index.umd.cjs",
    "module": "build/index.js",
    "types": "build/types.d.ts",
    "targets": {
        "main": false
    },
    "files": [
        "build"
    ],
    "exports": {
        ".": {
            "import": "./build/index.js",
            "require": "./build/index.umd.js"
        }
    },

Basically, it seems to need the targets object for some reason, possibly because it isn't outputting more than 1 file at a time?

I realise that there is not enough information to make a repro (and therefore debug), so I don't know how valuable this is from that point of view, but other people encountering this issue might look to see if they are trying to output more than one file at the same time... or try adding the targets parameter to package.json. 🤷

@S-unya
Copy link

S-unya commented Feb 2, 2023

To be clear, the issue is having any of the outputs using the same file "name" (the .umd and file type are not taken into account)

@devongovett
Copy link
Member

devongovett commented Mar 22, 2023

I investigated this a bit more with @snowystinger. Our theory is that there is a race condition which can fail when you have the same CSS asset being loaded in multiple environments (e.g. node and browser, or main and module). We believe what's happening is that a CSS file is requested from two different environments simultaneously, e.g. two dependencies for the same file with different environments. We go to the CSS transformer, and this normalizes the environment to prevent duplicate assets from being created:

asset.setEnvironment({
context: 'browser',
engines: {
browsers: asset.env.engines.browsers,
},
shouldOptimize: asset.env.shouldOptimize,
shouldScopeHoist: asset.env.shouldScopeHoist,
sourceMap: asset.env.sourceMap,
});

This means that the two transformation requests resolve to the same asset id. However, if one of them finishes first while the other one is still running, it could move on to the dependencies of that CSS file (e.g. an SVG). Then, when the second one comes back and resolves to the same asset, this will try to replace the child nodes of that asset with new dependencies.

this.replaceNodeIdsConnectedTo(
this.getNodeIdByContentKey(assetNode.id),
depNodeIds,
);

Finally, when the request for the dependency from the first transformation (e.g. SVG) comes back, the node is no longer there because it was replaced by the second instance and it blows up here:

I'm not exactly sure how to fix this yet, but thought I'd write down some notes.

@mrcoles
Copy link

mrcoles commented Apr 16, 2023

I ran into this issue (@parcel/bundler-default: Expected content key … to exist) when I had CSS imports in a JS file (both a .scss file and a tailwind one import './index.scss'; import './tailwind.css';). When I moved them into my HTML file (as <link rel="stylesheet" type="text/css" … />) the error went away.

@cipherlogs might this have been the same issue you were seeing?

@cipherlogs
Copy link

@mrcoles Yes it could be, I stopped using Parcel, I just use Vite now.

@mrcoles
Copy link

mrcoles commented Apr 20, 2023

@devongovett I have experienced this on multiple projects now. I can’t share a sample repo, yet, but here’s some info to try and help triangulate:

  • While running serve or watch, I’m getting the error @parcel/bundler-default: Expected content key <HASH_KEY> to exist
  • This is happening on parcel 2.8.3, but so far not on parcel 2.8.2—despite clearing the cache and rebuilding I kept getting it, but I reverted the following deps from 2.8.3 to 2.8.2 in my repo and the error went away:
    • @parcel/packager-raw-url@2.8.2
    • @parcel/packager-xml@2.8.2
    • @parcel/transformer-inline@2.8.2
    • @parcel/transformer-inline-string@2.8.2
    • @parcel/transformer-mdx@2.8.2
    • @parcel/transformer-sass@2.8.2
    • @parcel/transformer-typescript-tsc@2.8.2
    • @parcel/transformer-webmanifest@2.8.2
    • @parcel/transformer-xml@2.8.2
    • @parcel/transformer-yaml@2.8.2
    • parcel@2.8.2
  • On a separate project, I was able to stay on 2.8.3, but I had to remove all JS imports of CSS files and move them all into a single .css <link /> in my main index.html file and that fixed it
  • Both projects are using tailwind, IDK if that’s relevant or a red herring (see my prior comment on this thread)

@EwyBoy
Copy link

EwyBoy commented Jun 7, 2023

I fixed it for me by removing these from my index.less file:

@font-face {
  font-family: "Open Sans";
  src: url("./fonts/Open_Sans/OpenSans-Regular.ttf");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Open Sans";
  src: url("./fonts/Open_Sans/OpenSans-SemiBold.ttf");
  font-weight: 600;
  font-style: bold;
}

@font-face {
  font-family: "Open Sans";
  src: url("./fonts/Open_Sans/OpenSans-Bold.ttf");
  font-weight: 700;
  font-style: normal;
}

Parcel v2.8.3

@Harikesavan77
Copy link

hi there, i am getting this errror for the past two days. i tried to unistall cache ,and to install better version of parcel but i am still getting this error what should i do
Expected content key d887f3ca450c74ac to exist

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

@devongovett devongovett removed their assignment Oct 14, 2023
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.