question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parcel won't stop rebuilding in dev mode

See original GitHub issue

🐛 bug report

Running parcel in “dev mode” on OS X just constantly rebuilds which triggers reloads making it impossible to work with 😦

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

package.json

{
  "name": "ozzie",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "parcel ./index.html",
    "test": "mocha --timeout=10000",
    "dbemulator": "firebase serve --only firestore"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "antd": "^3.20.1",
    "dotenv": "^8.0.0",
    "firebase": "^6.3.0",
    "firebase-init": "^1.3.2",
    "formik": "^1.5.8",
    "moment": "^2.24.0",
    "query-string": "^6.8.2",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-redux": "^7.1.0",
    "react-redux-firebase": "^3.0.0-alpha.13",
    "react-router-dom": "^5.0.1",
    "recompose": "^0.30.0",
    "redux": "^4.0.4",
    "redux-firestore": "^0.8.0"
  },
  "devDependencies": {
    "@babel/core": "^7.5.5",
    "@babel/plugin-proposal-class-properties": "^7.5.5",
    "@babel/plugin-transform-runtime": "^7.5.5",
    "@babel/preset-env": "^7.5.5",
    "@babel/preset-react": "^7.0.0",
    "@babel/runtime": "^7.5.5",
    "babel-loader": "^8.0.6",
    "babel-polyfill": "^6.26.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "parcel-bundler": "^1.12.3",
    "@firebase/testing": "0.10.0",
    "filesystem": "1.0.1",
    "mocha": "5.2.0",
    "should": "^13.2.3"
  }
}

.babelrc

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "browsers": [
            ">0.25%",
            "not ie 11",
            "not op_mini all"
          ]
        }
      }
    ],
    "@babel/preset-react"
  ],
  "plugins": [
    "@babel/plugin-transform-runtime",
    "@babel/plugin-proposal-class-properties"
  ]
}

🤔 Expected Behavior

It should only rebuild and reload when I save a file.

😯 Current Behavior

Constantly rebuilding and causing refreshing. The gif below you can see. I’m doing absolutely nothing but sitting and watching my terminal.

rebuild

💁 Possible Solution

Maybe not a solution per se but it’d be nice to get some info on what is causing this refresh. Something is triggering a “change” event, but what?

🔦 Context

Just a brain dump but I’m working in IntelliJ. I tried IntelliJ’s terminal and iTerm. I’ve tried deleting node_modules, dist, .cache, and package-lock. I’ve reinstalled npm modules multiple times.

💻 Code Sample

I can’t publicly share the code but it’s a pretty simple React app that uses Firebase and Firestore.

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node 10.16.0
npm/Yarn 6.9.0
Operating System Mac OS 10.14.1 (18B75)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
ManzDevcommented, Oct 27, 2020

I create a new example from scratch on my system and now works perfectly.

I have been working fine with no problems for a while. Sometimes, when write an import to a .js file and save, infinite looping has started.

  • If I break (CTLR-C) and restart Parcel, it continues loop.
  • If I delete the .parcel-cache folder and restart Parcel, works correctly again.
1reaction
DestroyOnLoadcommented, Dec 15, 2020

I create a new example from scratch on my system and now works perfectly.

I have been working fine with no problems for a while. Sometimes, when write an import to a .js file and save, infinite looping has started.

  • If I break (CTLR-C) and restart Parcel, it continues loop.
  • If I delete the .parcel-cache folder and restart Parcel, works correctly again.

Thank you! Completely the issue I was dealing with. Not sure what was in the cache triggering the change event, but it’s simple enough to let parcel just rebuild.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Error: Parcel Won't Stop Rebuilding in Dev Mode
What did work to fix this error, was to delete the .parcel_cache folder and to restart parcel again. Which seems to work fine,...
Read more >
Development - Parcel
Caching. Parcel caches everything it builds to disk. If you restart the dev server, Parcel will only rebuild files that have changed since...
Read more >
CLI - Parcel
Starts up a development server, which will automatically rebuild your app as you change files and supports hot module replacement.
Read more >
Bundling and Building with Parcel - Beginner JavaScript
Note: if you ever have issues with Parcel being weird where you fixed something but it doesn't seem to be fixed, open up...
Read more >
Senate Bill 9 - Department of Planning and Development
A parcel/lot within a single-family residential zoning district and within a U.S. Census defined urbanized area is potentially eligible for ministerial ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found