Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Zethson opened this issue Dec 7, 2023 · 8 comments · Fixed by #255
Closed

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

Zethson opened this issue Dec 7, 2023 · 8 comments · Fixed by #255
Assignees

Comments

@Zethson
Copy link
Member

Zethson commented Dec 7, 2023

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
Copy link
Member Author

Zethson commented Dec 7, 2023

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

@Zethson Zethson self-assigned this Dec 7, 2023
@grst
Copy link
Collaborator

grst commented Dec 7, 2023

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
Copy link
Member

flying-sheep commented Dec 7, 2023

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
Copy link
Collaborator

grst commented Dec 7, 2023

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

@flying-sheep
Copy link
Member

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
Copy link
Collaborator

grst commented Dec 8, 2023

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
Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants