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

Fix Cannot read properties of undefined (reading 'name') #718

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

christianvuerings
Copy link
Contributor

Description

We see the following exception when running the latest versions of knip

file:///Users/christian/project/node_modules/knip/dist/typescript/visitors/dynamic-imports/importCall.js:33
                                else if (ts.isObjectBindingPattern(arg.name)) {
                                                                       ^

TypeError: Cannot read properties of undefined (reading 'name')
    at file:///Users/christian/project/node_modules/knip/dist/typescript/visitors/dynamic-imports/importCall.js:33:72
    at file:///Users/christian/project/node_modules/knip/dist/typescript/visitors/index.js:4:35

Version: Any version >5.22.1
Root cause: 1343826#diff-4f5da9f532afb6319ca695a791c6d09766d095bdb5e2466bd1aa989e58823ebbR47

Note

Even with --debug I wasn't able to figure out which file caused the issue

Copy link

netlify bot commented Jul 8, 2024

‼️ Deploy request for knip rejected.

Name Link
🔨 Latest commit 6433395

@webpro
Copy link
Collaborator

webpro commented Jul 8, 2024

Apparently the fixtures didn't cover a specific case like .then((null) => {}) with an argument like null or a string and/or without parenthesis. Going to just merge and publish this as it looks safe. Thanks!

@webpro webpro merged commit f0f9f5a into webpro-nl:main Jul 8, 2024
11 checks passed
@webpro
Copy link
Collaborator

webpro commented Jul 8, 2024

🚀 This pull request is included in v5.24.3. See Release 5.24.3 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

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 this pull request may close these issues.

2 participants