-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
patch-package 6.2.2 • Creating temporary folder SyntaxError: Unknown token: { line: 3, col: 2, type: 'INVALID', value: undefined } 3:2 in lockfile #272
Comments
Are you using Yarn 2? |
I am. and I'm also dealing with the same error here |
|
thanks! is it possible to call yarn 1 from within a yarn 2 project? |
No it's not. An "easy" way would be something like this:
Make your changes inside
And copy over the patch file. |
got it! thanks! |
…rn 2 not yet supported for patch-creation, so used workaround here: ds300/patch-package#272 (comment))
why? |
Hi. Just faced this issue on |
@punndcoder28 I think you don't need First run
|
faker를 빌드할 때 export = faker; 구문에서 에러가 나서 라이브러리 수정 후 patch-package로 해결 yarn berry에서 patch-package가 제대로 실행이 되지않아서 하기 이슈 참고하여 해결 - npm 기반 프로젝트에서 patch-package 실행 후 patch 파일 옮겨서 진행 - ds300/patch-package#272 ref #29
faker를 빌드할 때 export = faker; 구문에서 에러가 나서 라이브러리 수정 후 patch-package로 해결 yarn berry에서 patch-package가 제대로 실행이 되지않아서 하기 이슈 참고하여 해결 - npm 기반 프로젝트에서 patch-package 실행 후 patch 파일 옮겨서 진행 - ds300/patch-package#272 ref #29
@hos's method works great, with one caveat: yarn doesn't seem to warn you if your patch is no longer being applied, or your Unlike This was enough to waste half a day for me, and force me to switch back to Edit: the specific failure case I ran into was using yarn berry + node_modules linker, then the package I patched had a new version released (minor), and so the resolutions stopped matching and the patch was silently ignored. But I didn't realise that for many frustrating hours. Whereas when the versions mismatch in |
Here's a script that automates @gabrielbull's method to the point it's the same as using
Save it as This way you can test your changes of the dependency in the project you're using this dependency and then save the patch with a one-liner, just like before. There's probably a way to save this script and alias it globally, but I am OK with how it turned out already, so I'll leave it for someone else P.S. this solution might seem a bit crude compared to switching to |
Also, for anyone wishing to use |
I have the same issue with Yarn |
- https://github.com/ds300/patch-package/tree/v6.4.7 - ds300/patch-package#272 Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- yarn patch-commit is used to generate patches. patch-package can not be used to apply those patches on install due to directory mismatches (e.g. a/index.js vs a/node_modules/globby/index.js). patches cannot be created with patch-package either - ds300/patch-package#272 - https://git-scm.com/docs/git-apply - https://yarnpkg.com/cli/patch-commit - https://yarnpkg.com/cli/patch Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- yarn patch-commit is used to generate patches. patch-package cannot be used to apply those patches on install due to directory mismatches (e.g. a/index.js vs a/node_modules/globby/index.js). patches cannot be created with patch-package either - ds300/patch-package#272 - https://git-scm.com/docs/git-apply - https://yarnpkg.com/cli/patch-commit - https://yarnpkg.com/cli/patch Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- yarn patch-commit is used to generate patches. patch-package cannot be used to apply those patches on install due to directory mismatches (e.g. a/index.js vs a/node_modules/globby/index.js) - ds300/patch-package#272 - https://git-scm.com/docs/git-apply - https://yarnpkg.com/cli/patch-commit Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- yarn patch-commit is used to generate patches. patch-package cannot be used to apply those patches on install due to directory mismatches (e.g. a/index.js vs a/node_modules/globby/index.js) - ds300/patch-package#272 - https://git-scm.com/docs/git-apply - https://yarnpkg.com/cli/patch-commit Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
I ended up checking out from a commit in my project where I used yarn v1, updated patch there, stashed it, and then checked back where I was before and committed my patch there, popping it from stash. Couldn't find a way to easily transfer my old patch-package patches to yarn v3 format. |
I've just publish my PR #507 as |
No description provided.
The text was updated successfully, but these errors were encountered: