typicode / husky

Git hooks made easy 🐶 woof!
https://typicode.github.io/husky
MIT License
31.75k stars 999 forks source link

Init Broken in 9.0.4 #1351

Closed gflohr closed 4 months ago

gflohr commented 4 months ago

Troubleshoot

If you're migrating from husky 4, see: https://typicode.github.io/husky/migrate-from-v4.html

Context

init
file:///path/to/node_modules/husky/bin.js:10
  (d.scripts ||= {}).prepare = 'husky'
   ^

ReferenceError: Cannot access 'd' before initialization
    at file:///path/to/node_modules/husky/bin.js:10:4
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:66:12)

Node.js v20.8.1

Downgrading to 9.0.3 fixed the problem.

Felipellira commented 4 months ago

Same here

sankaSanjeeva commented 4 months ago

+1

typicode commented 4 months ago

Sorry, it's fixed. I've added a test to avoid regressions.

sankaSanjeeva commented 4 months ago

@typicode Thank you for your prompt response