SyntaxError for UploadThing
using any UploadThing component breaks my code, because of this error
I dont seem to know where I'm messing up,
14 Replies
Currently trying the app router examples here to no avail too:
https://github.com/pingdotgg/uploadthing/tree/main/examples/appdir
GitHub
uploadthing/examples/appdir at main · pingdotgg/uploadthing
File uploads for modern web devs. Contribute to pingdotgg/uploadthing development by creating an account on GitHub.
Do you have a public repo I can take a look at? What package manager are you using?
Hi mark, here's my repo:
https://github.com/louisuy/Next-13-Social-Media-App/tree/uploadthing
GitHub
GitHub - louisuy/Next-13-Social-Media-App at uploadthing
Contribute to louisuy/Next-13-Social-Media-App development by creating an account on GitHub.
And I use npm.
We have noticed some oddities with npm recently, though ideally you should be able to use any package manager.
I will check out your repo shortly!
Yeah it surely is odd, cause the moment
<UploadButton ... />
or <UploadDropzone ... />
is uncommented/pasted in, the page breaks. And all I get in the logs are: Where everything else seems to be fine, and atleast 1:1 with the docs.IT looks like you don't have the API route or file router definition in this repo
That error actually makes sense if you are missing the API route, because it will try to hit that endpoint, and get back an HTML response (instead of JSON)
Those are the files in the docs, which are these right?
Yep those are the ones
Yeah they exist in that branch in the repo, let me add it to the main and let me push.
Okay yeah, I've brought it back to the master branch, and still I've replicated
Hey @markr, I've fixed it, It had to do with:
This
metadata
which remained unused.
Removing it fixed it.Ah, interesting. Will definitely have to look into that. Cc @theo