You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a project where I have "type": "module" in my package.json, the hooks fail with this error:
scott@Fresh MINGW64 ~/Code/Repos/project (main)$ git checkout hooks-test
Switched to branch 'hooks-test'
M package.json
M pnpm-lock.yaml
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for C:\Users\scott\Code\Repos\project\.git\hooks\post-checkout
at new NodeError (node:internal/errors:371:5)
at Object.file: (node:internal/modules/esm/get_format:72:15)
at defaultGetFormat (node:internal/modules/esm/get_format:85: :38)
at defaultLoad (node:internal/modules/esm/load:13:42)
at ESMLoader.load (node:internal/modules/esm/loader:303:26) [39m
at ESMLoader.moduleProvider (node:internal/modules/esm/loader r:230:58)
at new ModuleJob (node:internal/modules/esm/module_job:63:26) ) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:2 244:11)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:2 281:24) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
When type is "module", the file with the shebang requires a file name extension (according to this answer on StackOverflow). That's obviously incompatible with Git's requirement for hooks not to have a file name extension. I'm not sure if there's a solution to that.
The text was updated successfully, but these errors were encountered:
brady-ds
added a commit
to brady-ds/ghooks
that referenced
this issue
Apr 27, 2023
Environment: Node 16.13.1 on Windows.
On a project where I have
"type": "module"
in mypackage.json
, the hooks fail with this error:When type is "module", the file with the shebang requires a file name extension (according to this answer on StackOverflow). That's obviously incompatible with Git's requirement for hooks not to have a file name extension. I'm not sure if there's a solution to that.
The text was updated successfully, but these errors were encountered: