-
Notifications
You must be signed in to change notification settings - Fork 131
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
Fix autogenerated append to original _headers file #851
Conversation
Vercel hard links the public directory so when next-on-pages appends to the vercel output directory, it is also appending to the original `public/_headers` file too. This commit fixes the problem by copying the contents to memory before unlinking the file and creating a new (non-linked) file. I was able to test out this patch and saw it worked for when `_headers` exists and when it is absent. Closes cloudflare#848
🦋 Changeset detectedLatest commit: b7ee058 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🧪 Prereleases are available for testing 🧪 @cloudflare/next-on-pagesYou can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/10282660127/npm-package-next-on-pages-851 @cloudflare/eslint-plugin-next-on-pagesYou can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/10282660127/npm-package-eslint-plugin-next-on-pages-851 |
packages/next-on-pages/src/buildApplication/buildMetadataFiles.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! Thanks a bunch @nickbabcock 🙂 ❤️
I've just left a minor comment, also could you run npm run prettier:fix
to format the code? 🙂🙏
Comments addressed, thank you 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! thanks a lot for updating the comment and formatting the code 🙏
I've left two minor very last comments 😅 🙇
packages/next-on-pages/src/buildApplication/buildMetadataFiles.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Dario Piotrowicz <[email protected]>
Once again thanks a lot @nickbabcock 🫶 |
Vercel hard links the public directory so when next-on-pages appends to file within the vercel output directory, it is also appending to the original
public/_headers
file too.This commit fixes the problem by copying the contents to memory before unlinking the file and creating a new (non-linked) file.
I was able to test out this patch and saw it worked for when
_headers
exists and when it is absent.Closes #848