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

[Bug?]: Problem with applying patch if there is "No newline at end of file" #6612

Open
1 task
adam-sajko opened this issue Nov 22, 2024 · 0 comments
Open
1 task
Labels
bug Something isn't working

Comments

@adam-sajko
Copy link

adam-sajko commented Nov 22, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

Here is the strange situation I had. I created and applied the patch, but it looks like if my changes are at the end of the file and there is \ No newline at end of file fragment in the patch (which is generated by the patch) then the patch doesn't apply the last line.

Context

I made a patch for @tamagui/web for v0.117.0:

  • I forked the original repo
  • I made changes in the original files
  • I run the build to get compiled files
  • I went to my project folder
  • I created a temporary patch folder with yarn patch @tamagui/web
  • I copied compiled files to that folder
  • I created a patch with yarn patch-commit -s
  • I double-checked all files and the patch to make sure everything is ok
  • I ran the app and I received an error

The issue was because there was no "}" and the end of node_modules/@tamagui/web/dist/cjs/helpers/getSplitStyles.cjs. This file btw. was generated by the tamagui build process when I was preparing the files for the patch, so I didn't make any manual changes in this file, and the patch, so we can exclude any human mistake.

Everything works fine after removing this line \ No newline at end of file. Or if I added manually a new line in the file for the patch.

Environment

System:
  OS: macOS 15.1
  CPU: (12) arm64 Apple M3 Pro
Binaries:
  Node: 20.14.0 - /private/var/folders/fc/74t23kl53h944kcvmqyfblgm0000gn/T/xfs-902e9090/node
  Yarn: 4.1.1 - /private/var/folders/fc/74t23kl53h944kcvmqyfblgm0000gn/T/xfs-902e9090/yarn
  npm: 10.8.1 - ~/.nvm/versions/node/v20.14.0/bin/npm
@adam-sajko adam-sajko added the bug Something isn't working label Nov 22, 2024
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

No branches or pull requests

1 participant