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

Husky: Cannot read properties of undefined (reading 'split') #10939

Open
quangpao opened this issue May 9, 2024 · 0 comments
Open

Husky: Cannot read properties of undefined (reading 'split') #10939

quangpao opened this issue May 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@quangpao
Copy link

quangpao commented May 9, 2024

What version of Bun is running?

1.1.8-canary.1+3c082012b

What platform is your computer?

Microsoft Windows NT 10.0.22621.0 x64

What steps can reproduce the bug?

  1. Install husky via command: bun add -d husky@latest
  2. Init the husky with command: bunx husky init
  3. Bug appeared

What is the expected behavior?

bunx husky init successfully without any issue.

What do you see instead?

PS D:\repos\fauto> bunx husky init
file:///D:/repos/fauto/node_modules/husky/bin.mjs:18
        w('.husky/pre-commit', p.env.npm_config_user_agent.split('/')[0] + ' test\n')
                                                           ^

TypeError: Cannot read properties of undefined (reading 'split')
    at file:///D:/repos/fauto/node_modules/husky/bin.mjs:18:53
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.12.2

Additional information

When I did the init with npx husky init, it worked as expected.

@quangpao quangpao added the bug Something isn't working label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant