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

declaredVersion is undefined in getPackageResolution #31

Open
milahu opened this issue Nov 1, 2022 · 0 comments
Open

declaredVersion is undefined in getPackageResolution #31

milahu opened this issue Nov 1, 2022 · 0 comments

Comments

@milahu
Copy link
Owner

milahu commented Nov 1, 2022

function getPackageResolution({ packageDetails, packageManager, appPath, appPackageJson, }) {
// ...
    if (declaredVersion.startsWith('file:')) {
patch-package jest-snapshot
patch-package 6.4.14
• Creating temporary folder
/home/user/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@milahu/patch-package/dist/makePatch.js:435
        throw e;
        ^

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at getPackageResolution (/home/user/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@milahu/patch-package/dist/getPackageResolution.js:34:25)
    at makePatch (/home/user/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@milahu/patch-package/dist/makePatch.js:73:81)
    at /home/user/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@milahu/patch-package/dist/index.js:73:39

this happens when the package is not installed as top-level dependency

grep jest-snapshot package.json | wc -l
0
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

No branches or pull requests

1 participant