parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.48k stars 2.27k forks source link

needsExportsIdentifierForAsset - RangeError: Maximum call stack size exceeded #5914

Closed mischnic closed 3 years ago

mischnic commented 3 years ago

🐛 bug report

Found by packages/dev/esm-fuzzer

😯 Current Behavior

RangeError: Maximum call stack size exceeded
    at Graph.getNodesConnectedTo (parcel/packages/core/core/src/Graph.js:117:22)
    at BundleGraph.getIncomingDependencies (parcel/packages/core/core/src/BundleGraph.js:1050:10)
    at BundleGraph.getIncomingDependencies (parcel/packages/core/core/src/public/BundleGraph.js:89:8)
    at needsExportsIdentifierForAsset (parcel/packages/shared/scope-hoisting/src/link.js:353:28)
    at some (parcel/packages/shared/scope-hoisting/src/link.js:368:11)
    at Array.some (<anonymous>)
    at needsExportsIdentifierForAsset (parcel/packages/shared/scope-hoisting/src/link.js:360:20)
    at some (parcel/packages/shared/scope-hoisting/src/link.js:368:11)
    at Array.some (<anonymous>)
    at needsExportsIdentifierForAsset (parcel/packages/shared/scope-hoisting/src/link.js:360:20)

💻 Code Sample

This will need to be boiled down to be minimal first...

{
  files: {
    '0.mjs': 'import { f as h } from "./1.mjs";\n' +
      'import { k as m } from "./0.mjs";\n' +
      'import { q as t } from "./0.mjs";\n' +
      'import { aa as ac } from "./1.mjs";\n' +
      'import { aa as ad } from "./1.mjs";\n' +
      'import { af as ah } from "./0.mjs";\n' +
      'import { an as ap } from "./4.mjs";\n' +
      'import { an as ar } from "./4.mjs";\n' +
      'import { hz as jz } from "./6.mjs";\n' +
      'import { aaf as aai } from "./2.mjs";\n' +
      'import { aaf as aat } from "./2.mjs";\n' +
      'import { aau as aaw } from "./2.mjs";\n' +
      'import { abz as ahz } from "./2.mjs";\n' +
      'const l = "R5H2q";\n' +
      'const r = "YdXYn";\n' +
      'const ag = "n2ZZ4";\n' +
      'export { c } from "./2.mjs";\n' +
      'export { l as k };\n' +
      'export { r as q };\n' +
      'export { ag as af };\n' +
      'export { e } from "./12.mjs";',
    '1.mjs': 'import { f as i } from "./1.mjs";\n' +
      'import { f as j } from "./1.mjs";\n' +
      'import { k as n } from "./0.mjs";\n' +
      'import { k as o } from "./0.mjs";\n' +
      'import { k as p } from "./0.mjs";\n' +
      'import { q as s } from "./0.mjs";\n' +
      'import { q as u } from "./0.mjs";\n' +
      'import { au as aw } from "./3.mjs";\n' +
      'import { au as ay } from "./3.mjs";\n' +
      'import { lz as qz } from "./1.mjs";\n' +
      'import { uz as wz } from "./5.mjs";\n' +
      'import { uz as yz } from "./5.mjs";\n' +
      'import { uz as aac } from "./5.mjs";\n' +
      'import { uz as aad } from "./5.mjs";\n' +
      'import { abz as anz } from "./2.mjs";\n' +
      'const g = "pC3Y0";\n' +
      'const w = "-tL2z";\n' +
      'const ab = "38AeO";\n' +
      'const fz = "iFCom";\n' +
      'const mz = "hOXQ1";\n' +
      'const arz = "QMmGL";\n' +
      'export { g as f };\n' +
      'export { w as x };\n' +
      'export { ab as aa };\n' +
      'export { c } from "./9.mjs";\n' +
      'export { z } from "./11.mjs";\n' +
      'export { fz as gz };\n' +
      'export { mz as lz };\n' +
      'export { arz as asz };',
    '2.mjs': 'import { q as v } from "./0.mjs";\n' +
      'import { aa as ae } from "./1.mjs";\n' +
      'import { af as aj } from "./0.mjs";\n' +
      'import { abz as adz } from "./2.mjs";\n' +
      'import { abz as aiz } from "./2.mjs";\n' +
      'import { abz as ajz } from "./2.mjs";\n' +
      'const bz = "kRGT_";\n' +
      'const aag = "SWrzs";\n' +
      'const aav = "JN-NC";\n' +
      'const acz = "T9hRy";\n' +
      'export { c } from "./6.mjs";\n' +
      'export * from "./10.mjs";\n' +
      'export { bz as cz };\n' +
      'export { aag as aaf };\n' +
      'export { aav as aau };\n' +
      'export { acz as abz };\n' +
      'export * as aqz from "./9.mjs";',
    '3.mjs': 'import { af as ak } from "./0.mjs";\n' +
      'import { lz as oz } from "./1.mjs";\n' +
      'import { aaf as aaj } from "./2.mjs";\n' +
      'import { aaf as aal } from "./2.mjs";\n' +
      'import { aaf as aap } from "./2.mjs";\n' +
      'import { abz as amz } from "./2.mjs";\n' +
      'const d = "jkjBK";\n' +
      'const av = "AdxoD";\n' +
      'export { d as e };\n' +
      'export { av as au };',
    '4.mjs': 'import { au as ax } from "./3.mjs";\n' +
      'import { uz as aab } from "./5.mjs";\n' +
      'const ao = "vDVc4";\n' +
      'export { ao as an };\n' +
      'export { e } from "./13.mjs";\n' +
      'export * from "./7.mjs";',
    '5.mjs': 'import { an as aq } from "./4.mjs";\n' +
      'import { an as at } from "./4.mjs";\n' +
      'import { au as az } from "./3.mjs";\n' +
      'import { aau as aaz } from "./2.mjs";\n' +
      'import { abz as alz } from "./2.mjs";\n' +
      'const vz = "j1_V4";\n' +
      'export * from "./4.mjs";\n' +
      'export { vz as uz };',
    '6.mjs': 'import { af as ai } from "./0.mjs";\n' +
      'import { lz as nz } from "./1.mjs";\n' +
      'import { aaf as aah } from "./2.mjs";\n' +
      'const iz = "sI0xo";\n' +
      'export { c } from "./7.mjs";\n' +
      'export { iz as hz };',
    '7.mjs': 'import { aaf as aam } from "./2.mjs";\n' +
      'import { aau as aax } from "./2.mjs";\n' +
      'const al = "qQvzd";\n' +
      'export { c } from "./1.mjs";\n' +
      'export { al as am };\n' +
      'export * as aae from "./10.mjs";',
    '8.mjs': 'import { lz as sz } from "./1.mjs";\n' +
      'import { aaf as aak } from "./2.mjs";\n' +
      'import { aaf as aar } from "./2.mjs";\n' +
      'import { aaf as aas } from "./2.mjs";\n' +
      'import { aau as aay } from "./2.mjs";\n' +
      'export * from "./14.mjs";',
    '9.mjs': 'import { lz as pz } from "./1.mjs";\n' +
      'import { uz as zz } from "./5.mjs";\n' +
      'import { uz as aaa } from "./5.mjs";\n' +
      'import { aaf as aao } from "./2.mjs";\n' +
      'import { aaf as aaq } from "./2.mjs";\n' +
      'import { abz as aez } from "./2.mjs";\n' +
      'import { abz as afz } from "./2.mjs";\n' +
      'const b = "pdvp9";\n' +
      'export { b as c };',
    '10.mjs': 'import { lz as rz } from "./1.mjs";\n' +
      'import { uz as xz } from "./5.mjs";\n' +
      'const aoz = "e7n_R";\n' +
      'export * from "./8.mjs";\n' +
      'export { aoz as apz };',
    '11.mjs': 'import { hz as kz } from "./6.mjs";\n' +
      'import { lz as tz } from "./1.mjs";\n' +
      'import { aaf as aan } from "./2.mjs";\n' +
      'import { abz as akz } from "./2.mjs";\n' +
      'const y = "6oWmH";\n' +
      'const dz = "utlBi";\n' +
      'export { y as z };\n' +
      'export { dz as ez };',
    '12.mjs': 'import { abz as agz } from "./2.mjs";\nexport { e } from "./4.mjs";',
    '13.mjs': 'export { e } from "./3.mjs";',
    '14.mjs': 'export * from "./5.mjs";',
    'package.json': '{\n' +
      '  "sideEffects": [\n' +
      '    "0.mjs",\n' +
      '    "3.mjs",\n' +
      '    "4.mjs",\n' +
      '    "5.mjs",\n' +
      '    "6.mjs",\n' +
      '    "8.mjs",\n' +
      '    "9.mjs",\n' +
      '    "10.mjs",\n' +
      '    "11.mjs",\n' +
      '    "12.mjs",\n' +
      '    "13.mjs"\n' +
      '  ]\n' +
      '}'
  },
  entries: [ '0.mjs' ]
}

🌍 Your Environment

Software Version(s)
Parcel 46af2476ecb78921af21432f978d863fbffafd9d
Node v15.9.0
devongovett commented 3 years ago

I think this function doesn't exist anymore