Repository: parcel-bundler/parcel
File: packages/core/core/src/requests/AssetGraphRequest.js (JavaScript)

Code before:
          } else if (!hasNamespaceReexport) {
            let loc = incomingDep.value.symbols?.get(s)?.loc;
            let [resolutionNodeId] = this.assetGraph.getNodeIdsConnectedFrom(
              this.assetGraph.getNodeIdByContentKey(incomingDep.id),
            );
            let resolution = nullthrows(
              this.assetGraph.getNode(resolutionNodeId),
            );
            invariant(resolution && resolution.type === 'asset_group');

            errors.push({
              message: md`${fromProjectPathRelative(
                resolution.value.filePath,
              )} does not export '${s}'`,
              origin: '@parcel/core',
              codeFrames: loc
                ? [
                    {
                      filePath:
                        fromProjectPath(
                          this.options.projectRoot,
                          loc?.filePath,
                        ) ?? undefined,
                      language:
                        incomingDep.value.sourceAssetType ??
                        assetNode.value.type,
                      codeHighlights: [
                        {
                          start: loc.start,
                          end: loc.end,
                        },
                      ],
                    },
                  ]
                : undefined,
            });
          }
        }

        if (!equalSet(incomingDepUsedSymbolsUpOld, incomingDep.usedSymbolsUp)) {
          incomingDep.usedSymbolsUpDirtyUp = true;
        }

        incomingDep.excluded = false;
        if (
          incomingDep.value.symbols != null &&
          incomingDep.usedSymbolsUp.size === 0
        ) {
          let assetGroups = this.assetGraph.getNodeIdsConnectedFrom(
            this.assetGraph.getNodeIdByContentKey(incomingDep.id),
          );

Review comment (suggestion):
`assetNode.value.type` is never correct, so this should rather be
```suggestion
                      language: incomingDep.value.sourceAssetType ?? undefined,
```

Code after:
          } else if (!hasNamespaceReexport) {
            let loc = incomingDep.value.symbols?.get(s)?.loc;
            let [resolutionNodeId] = this.assetGraph.getNodeIdsConnectedFrom(
              this.assetGraph.getNodeIdByContentKey(incomingDep.id),
            );
            let resolution = nullthrows(
              this.assetGraph.getNode(resolutionNodeId),
            );
            invariant(resolution && resolution.type === 'asset_group');

            errors.push({
              message: md`${fromProjectPathRelative(
                resolution.value.filePath,
              )} does not export '${s}'`,
              origin: '@parcel/core',
              codeFrames: loc
                ? [
                    {
                      filePath:
                        fromProjectPath(
                          this.options.projectRoot,
                          loc?.filePath,
                        ) ?? undefined,
                      language: incomingDep.value.sourceAssetType ?? undefined,
                      codeHighlights: [
                        {
                          start: loc.start,
                          end: loc.end,
                        },
                      ],
                    },
                  ]
                : undefined,
            });
          }
        }

        if (!equalSet(incomingDepUsedSymbolsUpOld, incomingDep.usedSymbolsUp)) {
          incomingDep.usedSymbolsUpDirtyUp = true;
        }

        incomingDep.excluded = false;
        if (
          incomingDep.value.symbols != null &&
          incomingDep.usedSymbolsUp.size === 0
        ) {
          let assetGroups = this.assetGraph.getNodeIdsConnectedFrom(
            this.assetGraph.getNodeIdByContentKey(incomingDep.id),
          );
          if (assetGroups.length === 1) {
            let [assetGroupId] = assetGroups;