parcel-bundler / parcel

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

Incompatibility with watchman #7871

Closed raaaahman closed 2 years ago

raaaahman commented 2 years ago

🐛 bug report

When trying to launch development server with parcel src/index.html -p 8000, I have the following error:

[Error: std::domain_error: invalid clockspec]

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

package.json

{
    "name": "battle-for-liliputia",
    "version": "0.1.0",
    "description": "A tug of war strategy game to be finished for Finally Finished Something 2022 game jam using Phaser 3 and bitECS",
    "scripts": {
        "start": "parcel src/index.html -p 8000",
        "build": "parcel build src/index.html",
        "test": "echo \"Error: no test specified\" && exit 1",
        "lint": "eslint ./src --ext .js,.jsx,.ts,.tsx"
    },
    "author": "raaaahman",
    "repository": {
        "type": "git",
        "url": "https://github.com/raaaahman/bug-of-war.git"
    },
    "homepage": "https://github.com/raaaahman/bug-of-war",
    "devDependencies": {
        "@parcel/packager-xml": "^2.2.1",
        "@parcel/transformer-xml": "^2.2.1",
        "@typescript-eslint/eslint-plugin": "^2.29.0",
        "@typescript-eslint/parser": "^2.29.0",
        "eslint": "^8.2.0",
        "minimist": ">=1.2.2",
        "parcel": "^2.1.1",
        "typescript": "^3.8.3"
    },
    "dependencies": {
        "bitecs": "^0.3.29",
        "phaser": "^3.55.2",
        "phaser3-rex-plugins": "^1.1.66"
    },
    "parcelCleanPaths": [
        "dist"
    ],
    "staticFiles": {
        "staticPath": "public",
        "distDir": "dist"
    },
    "browserslist": "> 0.5%, last 2 versions, not dead"
}

tsconfig.json

{
    "compilerOptions": {
        "target": "es2016",
        "module": "es6",
        "strict": true,
        "noImplicitAny": false,
        "noEmit": true,
        "allowJs": true,
        "jsx": "preserve",
        "importHelpers": true,
        "moduleResolution": "node",
        "experimentalDecorators": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "sourceMap": true,
        "baseUrl": "./src",
        "paths": {
          "~/*": ["./*"]
        },
        "typeRoots": [
            "node_modules/@types",
            "node_module/phaser/types"
        ],
        "types": [
            "phaser"
        ]
    },
    "include": [
        "src/**/*"
    ]
}

No .babelrc, no .parcelrc

🤔 Expected Behavior

I expect to be able to run projects using fb-watchman (for React Native) and projects using Parcel (for web) on the same development environment.

Sure, I could still use VM / containers for each environment, but I'd rather not to if possible.

💁 Possible Solution

Using fb-watchman for dev server seems to have already been discussed in #863 and #889 but not agreed upon.

Should I report to the chokidar project instead? Is a different watcher available for Parcel currently?

🌍 Your Environment

Software Version(s)
Parcel 2.1.1
Node 16.13.1
npm 8.1.2
Operating System Ubuntu 18.04.6 LTS
Watchman 2022.03.14.00-linux
mischnic commented 2 years ago

Is that really the whole error message?

Should I report to the chokidar project instead? Is a different watcher available for Parcel currently?

Parcel doesn't use chokidar but instead https://github.com/parcel-bundler/watcher

raaaahman commented 2 years ago

Yes it's the whole message, I even tried --log-level verbose but didn't get more info.

So I see that @parcel-bundler/watcher can use either Watchman or inotify backend on Linux, how can I see the one that's actually been used?

mischnic commented 2 years ago

In the function getWorkerBackend at the very bottom of node_modules/@parcel/core/lib/RequestTracker.js, you can change the function to return return {ignore, backend: "inotify"}; instead.

Possible values for backend: https://github.com/parcel-bundler/watcher/blob/caf372c41abff401a60dde698891631e3387ee77/index.d.ts#L4-L9

raaaahman commented 2 years ago

In my parcel version (2.2.1) the function is called getWatcherOptions but anyway, I have been able to change the backend in use, so:

Could we possibly configure this through a .env variable ?

Should I move this issue to @parcel/watcher ?

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

filipegiusti commented 1 year ago

I'm having the same problem. Could you find any solution that didn't involve changing code at node_modules/?

serkan-bayram commented 8 months ago

Deleting watchman package from my system solved the issue. I had this installed.