Uploadthing Expo is not reading the correct server URL
I'm using Expo with Uploadthing for a mobile app, testing it in Expo Go on IOS emulator on MacOS
When I upload images I get the error
Failed to parse response from UploadThing server
After hours of debugging I found out that UploadThing was not reading the correct env variable (in the docs it says EXPO_PUBLIC_SERVER_URL) so I take a look in the uploadthing code files and find another variable EXPO_PUBLIC_SERVER_ORIGIN (in @uploadthing/expo/dist/index.js) which still did not work
The only way to fix it was to change the way url is created in generateReactNativeHelpers from:
to:
And set the EXPO_PUBLIC_SERVER_ORIGIN variable to my backend's actual URL
Am I doing something wrong or is this a bug?3 Replies
I don't know if uploadthing has proper support, but if not you may want to put in an issue on their github https://github.com/pingdotgg/uploadthing/issues/new/choose
GitHub
Build software better, together
GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

Yeah I’ll just do an issue and a PR at this point
It’s a very simple fix
GitHub
[bug]:
uploadthing/expo does not read the env vairable correctly ...Provide environment information It is a monorepo so I ran the command only on the Expo app System: OS: macOS 15.6.1 CPU: (8) arm64 Apple M2 Memory: 454.17 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binari...

