Parcel: Circular Dependency Issue

Created on 27 Jun 2018  路  8Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

The issue I am having is when there are circular dependencies in my app and I am using npx parcel index.html command to run a dev server. The file is executed multiple times untill the maximum call stack size is exceeded.

{
  "presets": ["env", "react"],
  "plugins": [
    ["transform-runtime", {
      "polyfill": false,
      "regenerator": true
    }]
  ]
}

馃 Expected Behavior

Parcel rebuilds the javascript and the file is only executed once

馃槸 Current Behavior

The file is executed multiple times untill the maximum call stack size is exceeded.

image

馃敠 Context

I am having to change the file structure of my app to avoid this issue

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.0
| Node | 10.0.0
| npm/Yarn | 6.1.0
| Operating System | Debian GNU/Linux 9 (stretch)

Bug HMR

Most helpful comment

ran into this today. same issue.

All 8 comments

I think this bug has already been reported, but it's definitely something that needs to be fixed.

I'll leave this open as I'm not sure if this is a duplicate.

Is there any idea on a time frame or is there a work around to not hot reload certain files and then on page refresh it would reload the file?

ran into this today. same issue.

I've got the same with Parcel 1.10.3 and with Typescript (external compile).

  1. Run tsc -w
  2. Run parcel index.html
  3. Save .ts file in editor
  4. Get error
build.06da9ca9.js:54 Uncaught RangeError: Maximum call stack size exceeded
    at localRequire (build.06da9ca9.js:54)
    at Object.parcelRequire.build/view/Header.js.react (Header.tsx:1)
    at newRequire (build.06da9ca9.js:49)
    at hmrAccept (index.tsx:7)
    at index.tsx:7
    at Array.some (<anonymous>)
    at hmrAccept (index.tsx:7)
    at index.tsx:7
    at Array.some (<anonymous>)
    at hmrAccept (index.tsx:7)

Yep, same here. Circular dependency along with hot reload causes this issue.

Having the same issue.

Having the same issue here. Is there any workaround for now?

Duplicate of #1192

Was this page helpful?
0 / 5 - 0 ratings