scverse / cookiecutter-scverse

Cookiecutter template for scverse
https://cookiecutter-scverse-instance.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
71 stars 9 forks source link

Prettier 4.x is not compatible with old Node JS #254

Closed Zethson closed 11 months ago

Zethson commented 12 months ago
prettier.................................................................Failed
- hook id: prettier
- exit code: 1

node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1
node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1
node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1
node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1
node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1
node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1
node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1
node:internal/event_target:912
  process.nextTick(() => { throw err; });
                           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of TypeError
    at new NodeError (node:internal/errors:372:5)
    at EventTarget.dispatchEvent (node:internal/event_target:580:13)
    at Worker.<anonymous> (file:///home/zeth/.cache/pre-commit/repovvlei3jd/node_env-17.9.1/lib/node_modules/prettier/node_modules/webworker-shim/dist/node.js:38:18)
    at Worker.emit (node:events:527:28)
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.9.1

We originally fixed it due to #143. Unpinning nodejs fixed the issue for me.

Zethson commented 12 months ago

Is it time to get rid of this restriction @grst @flying-sheep ?

grst commented 12 months ago

yeah, I guess supporting a recent version of prettier is more important than an old os... though RHEL7-based systems are still surprisingly prevalent (including both my old and new jobs's HPCs)

flying-sheep commented 12 months ago

EOL of Centos 7 is in 2024-06, we can probably get rid of this then.

Original plan was this, but I’m not sure if CENTOS 7 on a dev machine makes sense.

Like, why run pre-commit on the HPC?

grst commented 12 months ago

Because you have a windows laptop an develop on the HPC using vscode remote extension

flying-sheep commented 12 months ago

Well, dev environments should be expected to be pretty up to date, as opposed to prod ones.

I think if one needs to develop in a slow moving environment, they should use something like dev containers or conda envs or so.

grst commented 11 months ago

If I'm not mistaken, even when using conda, the GLIBC is one of the few things that is still provided by the OS (or maybe it was just the package that didn't declare the dependency properly back then...)

Anyway, as mentioned above, I think it's more important to support a recent version of prettier than an old OS

flying-sheep commented 11 months ago

OK, then let’s unpin once prettier 4.0 is released (I really don’t like that pre-commit updates to pre-releases)

flying-sheep commented 11 months ago

OK, this is getting annoying. I wish there was a way to prevent pre-commit from updating to alpha versions, but it seems stable enough, and we can manually revert if we want to make a release before a prettier stable release or even beta comes up