-
Notifications
You must be signed in to change notification settings - Fork 2
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
TypeError: Cannot read property 'slice' of undefined #3
Comments
More info. At the line const { usages, tunable } = data; (https://github.com/itwillwork/dependencies-tree-builder/blob/master/src/scoupe_factory.js#L49) object
|
Monkey-patching helps to see at least some results const { usages, tunable } = data;
const carriers = {};
const sortedUsages = [...usages].sort(byLengthAsc);
- const dedupedUsages = sortedUsages.filter(usage => {
+ const dedupedUsages = sortedUsages.filter((usage = []) => {
let startUsagePath = 1;
if (hasOnlyOneVersion || tunable) {
startUsagePath = 0;
}
const effectiveUsage = usage.slice(startUsagePath); |
The problem is in package cache. If cache already exists and has any (even outdated) information about some library, then this information is used. Steps to reproduce:
|
Right now the easiest way to avoid this error is to delete const buildTreeAsync = require('dependencies-tree-builder');
const {scoupe} = await buildTreeAsync(packageJson, {useCache: false}); |
Sometimes I see an error when using this package
The text was updated successfully, but these errors were encountered: