[bug]: UploadButton Click Reloads Page Which Out Doing File Selection
Provide Environment Information
We are experiencing an issue with the UploadButton in our application, which is causing the page to reload immediately after clicking the button. This behavior is observed in both our Vercel deployment and local environment.
Environment Details
- Vercel Deployment: The issue is reproducible on our Vercel deployment at https://t3-sample-pi.vercel.app/.
- Reproduced Changeset: The changeset that reproduces the issue can be found at https://github.com/fallenreaper/t3-sample/commit/28f0f05dffea1cb7d4f200b871b3645a948b076e.
Describe the Bug
The issue occurs when attempting to upload a file using the UploadButton. The expected behavior is to select a file and then upload it, as demonstrated in the 0 to Production video at https://www.youtube.com/watch?v=d5x0JCZbAJs at approximately 1:01:48.
Expected Behavior
- Select a file using the file input element.
- Click the UploadButton to initiate the upload process.
Actual Behavior
- Upon clicking the UploadButton, the page immediately reloads, preventing the file selection and upload process from completing.
Notes
This issue is observed in our application using T3.js version 7.x, while the video demonstrating the upload process was created using T3.js version 6.x. We have noticed that the Clerk SignIn component now only accepts a single child element, so we have wrapped it in a div element to accommodate this change.
Link to Reproduction
The changeset that reproduces the issue can be found at https://github.com/fallenreaper/t3-sample/commit/28f0f05dffea1cb7d4f200b871b3645a948b076e.
To Reproduce
- Clone the repository using
pnpm install
. - Run the application using
pnpm dev
. - Log in to the application.
- Attempt to click the UploadButton.
Additional Information
We have reviewed the changelogs for T3.js version 7.x, but did not notice any changes that could be related to this issue. It is possible that there is a subtle change that we have missed.
Contributing
- Contributor: Yes, I'd be down to file a PR fixing this bug!
Code of Conduct
- Agreement: I agree to follow this project's Code of Conduct.
Possible Causes
Based on our investigation, we suspect that the issue may be related to a change in the T3.js version 7.x or a subtle change in the code. We are open to suggestions and would appreciate any help in resolving this issue.
Resolution
To resolve this issue, we need to identify the root cause and make the necessary changes to the application code. We are willing to collaborate with the community to find a solution and ensure that the issue is fixed.
Next Steps
- Review the application code and T3.js version 7.x changelogs to identify any potential causes.
- Collaborate with the community to gather more information and suggestions.
- Make the necessary changes to the application code to resolve the issue.
Q&A: Understanding the Issue and Finding a Solution
In our previous article, we discussed the issue with the UploadButton in our application, which causes the page to reload immediately after clicking the button. In this article, we will provide a Q&A section to help clarify the issue and potential solutions.
Q: What is the expected behavior of the UploadButton?
A: The expected behavior of the UploadButton is to select a file and then upload it, as demonstrated in the 0 to Production video at https://www.youtube.com/watch?v=d5x0JCZbAJs at approximately 1:01:48.
Q: What is the actual behavior of the UploadButton?
A: The actual behavior of the UploadButton is to reload the page immediately after clicking the button, preventing the file selection and upload process from completing.
Q: What are the possible causes of this issue?
A: Based on our investigation, we suspect that the issue may be related to a change in the T3.js version 7.x or a subtle change in the code. We are open to suggestions and would appreciate any help in resolving this issue.
Q: How can I reproduce the issue?
A: To reproduce the issue, follow these steps:
- Clone the repository using
pnpm install
. - Run the application using
pnpm dev
. - Log in to the application.
- Attempt to click the UploadButton.
Q: What are the system requirements for reproducing the issue?
A: The system requirements for reproducing the issue are:
- T3.js version 7.x
- Vercel deployment or local environment
- File input element and UploadButton component
Q: How can I contribute to resolving this issue?
A: We are open to suggestions and would appreciate any help in resolving this issue. You can contribute by:
- Reviewing the application code and T3.js version 7.x changelogs to identify any potential causes.
- Collaborating with the community to gather more information and suggestions.
- Making the necessary changes to the application code to resolve the issue.
Q: What is the next step in resolving this issue?
A: The next step in resolving this issue is to review the application code and T3.js version 7.x changelogs to identify any potential causes. We will also collaborate with the community to gather more information and suggestions.
Q: How can I stay updated on the progress of resolving this issue?
A: You can stay updated on the progress of resolving this issue by:
- Following our repository on GitHub.
- Joining our community channel on Discord.
- Subscribing to our newsletter.
We appreciate any help and suggestions from the community in resolving this issue.