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

🐛 knip 5.45 broke webpack context: "../" #998

Closed
6 tasks done
fregante opened this issue Mar 21, 2025 · 3 comments · May be fixed by #1009
Closed
6 tasks done

🐛 knip 5.45 broke webpack context: "../" #998

fregante opened this issue Mar 21, 2025 · 3 comments · May be fixed by #1009
Labels
bug Something isn't working

Comments

@fregante
Copy link

fregante commented Mar 21, 2025

Prerequisites

Reproduction url

https://stackblitz.com/edit/github-t8edctpr-diagajp2?file=config%2Fwebpack.config.js

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

v5.44.4 was fine but I v5.45 started failing to resolve files when context was specified.

The demo uses 5.46 and fails:

const path = require('path');

module.exports = {
  context: path.resolve(__dirname, '../src'),
  entry: {
    alpha: './alpha.js',
  },
};
[.] Unable to resolve deferResolveEntry:src/alpha.js (config/webpack.config.js)
[.] Unable to resolve deferResolveEntry:src/alpha.js (config/webpack.config.js)
[.] Finding entry paths
Unused files (1)
src/alpha.js

But v5.44.4 worked fine:

✂️  Excellent, Knip found no issues.

I think the issue is specifically about ../ because in my tests knip seemed to work correctly when context was ./src instead.

@fregante fregante added the bug Something isn't working label Mar 21, 2025
@webpro webpro closed this as completed in e43f88d Mar 23, 2025
@webpro
Copy link
Member

webpro commented Mar 23, 2025

Thanks for the report, should be good with the next release.

@webpro
Copy link
Member

webpro commented Mar 25, 2025

🚀 This issue has been resolved in v5.46.1. See Release 5.46.1 for release notes.

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

@fregante
Copy link
Author

Confirmed to be fixed, thank you!

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

Successfully merging a pull request may close this issue.

2 participants