WaspW
Wasp15mo ago
Obinna

File is not defined

My OpenSaas application has a file upload feature where you upload a file and send it to the nodejs backend (as a File object) to read the content, etc. It works fine on my macbook (wasp start), but once published to Railway, when I upload the file, I get the "ReferenceError: File is not defined" error. The line causing the error is "const reconstructedFile = new File([fileBase64], metadata.fileName, { type: metadata.fileType })"

I know that nodeJS doesn't understand the File object, but why does it work when I run it locally (via wasp start), but not on the Railway server? Aren't they both nodeJS environments?
Was this page helpful?