How to upload a PDF file to uploadthing from a route.ts file
This function is being called from a route.ts file. Im getting a vague error relating to some regex match in uploadthings source:
207 | // Pull out numbers from strings like
6.0.0
, ^6.4
, ~6.4.0
208 | const semverRegex = /(\d+).?(\d+)?.?(\d+)?/;
209 | const requiredMatch = required.match(semverRegex);| ^ 210 | if (!requiredMatch?.[0]) { 211 | throw new Error(
Invalid semver requirement: ${required}
);
212 | } {
From the documentation it seems like this is done very similarly with FormData files in an in-component server action, and I dont see what the difference would be here.2 Replies
@Taylor I think that might be related to somethign weird with peer deps, mind sharing your
package.json
?