UploadThing invalid secret error, invalid server config
Hi I'm using the UTapi and it stopped working with the new sdk API keys not sure what's going on
this project uses Astro
any help is appreciated thanks!
src/server/uploadthing.ts
api route
Error msg
27 Replies
Can you share the first ~10 characters of the token you are using?
UPLOADTHING_TOKEN='eyJhcGlLZXkiOiJza19saXZlXzc1MWIzYz
And if you decode the toke, it follows the expected format like mentioned in the error?
I haven't tried let me see
{"apiKey":"sk_live_751b3123412346324512341324123476b79c91af","appId":"fkz2323hfg","regions":["cle1"]}
I changed the api key ofc
lol
Hmm very strange, you definitely should not be getting that error. I am wondering if UTApi is not picking up on the token for some reason.
Can you try manually passing it in the constructor?
let me see
I think that might have worked not sure
I think there's a bug that got introduced somewhere
cc @julius -- weird effect thing
try removing node_modules and then re-installing. we've bumped effect so maybe you have 2 now fighting eachother
just tested - still got the same error - removed lock file just in case as well
did you bump both uplaodthing and @uploadthing/react ?
oof no I don't think so
"@uploadthing/react": "^7.0.2",
"uploadthing": "^7.0.2",
Are those what you’re using now?
Can you check the exact versions?
that's what I have in package.json
I think so yes
how so?
lockfile, node_moduels or
pnpm ls uploadthing && pnpm ls @uploadthing(react
i think?[email protected] /Users/malik/Desktop/Programs/naturual-language-file-conversion/file-converter-ai
├─┬ @uploadthing/[email protected]
│ └── [email protected] deduped
└── [email protected]
[email protected] /Users/malik/Desktop/Programs/naturual-language-file-conversion/file-converter-ai
└── @uploadthing/[email protected]
I check node modules as well to confirm these versions
Ok 👍 and what’s the error you’re getting now?
still the same error
🤨🤨🤨
should I update my package json?
try this? https://github.com/pingdotgg/uploadthing/blob/main/playground/app/layout.tsx#L43-L45
does that decode fine?
i've only seen this error happen when there're multiple effect versions but if that's not the case i don't know what it could be
is the repo open source?
its not could I dm it to you?
dies this work with astro? I'm using uploadthing from the server
yea those lines need to run on the server
On it
13:43:41 [ERROR] UploadThingToken is not defined
did you
did just now
13:44:27 [ERROR] ((Uint8ArrayFromBase64 <-> (Uint8ArrayFromSelf <-> string)) <-> ((JsonString <-> unknown) <-> (Struct (Encoded side) <-> Struct (Type side))))
└─ Encoded side transformation failure
└─ (Uint8ArrayFromBase64 <-> (Uint8ArrayFromSelf <-> string))
└─ Encoded side transformation failure
└─ Uint8ArrayFromBase64
└─ Transformation process failure
└─ Length must be a multiple of 4, but is 1
Stack trace:
I think the env is not getting loaded correctly
process.env.UPLOADTHING_TOKEN c
^ that's the result
its working!
I'm not sure what was wrong - maybe the install I'm not sure
Thanks guys
Definitley a weird issue
glad you got it sorted though!
me too! this is what I'm building if you are intrested https://fileconverterai.com
File Converter AI
Astro description