You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I create a new project with Remix. Now I use the project development and building with Vite. Today I reached the file downloading feature. I do everything as usual, according to the instructions on the Remix.dev website. I did this earlier, with a remix development server and everything worked well.
But now, when I'm trying to upload the file, the vite-plugin-remix gives the error "ReferenceError: File is not defined". This happens because file "/node_modules/@remix-run/node/dist/upload/fileUploadHandler.js:143" contains class member creted from class "File". This member is not used. I just comment it and uploading was successful.
"File" is a class of a browser environment, so Vite knows nothing about it on the server. I ask you to fix this bug.
My project env is remix 2.8.0, with vite-plugin-remix and with typescript.
ReferenceError: File is not defined
at <instance_members_initializer> (W:\Projects\alab-remix-2\node_modules\@remix-run\node\dist\upload\fileUploadHandler.js:143:20)
at new NodeOnDiskFile (W:\Projects\alab-remix-2\node_modules\@remix-run\node\dist\upload\fileUploadHandler.js:144:14)
at W:\Projects\alab-remix-2\node_modules\@remix-run\node\dist\upload\fileUploadHandler.js:131:12
...
at async requestHandler (W:\Projects\alab-remix-2\node_modules\@remix-run\server-runtime\dist\server.js:104:18)
at async nodeHandler (W:\Projects\alab-remix-2\node_modules\@remix-run\dev\dist\vite\plugin.js:781:27)
at async W:\Projects\alab-remix-2\node_modules\@remix-run\dev\dist\vite\plugin.js:784:15
The text was updated successfully, but these errors were encountered:
I created a new Remix-Vite project with minimal reproduction and the file download was successful.
It turned out to be in the file vite.config.ts of my project there was no installation of global variables:
import { installGlobals } from "@remix-run/node";
installGlobals();
I apologize for the concern. I hope this information is useful to someone.
Reproduction
Hello, I create a new project with Remix. Now I use the project development and building with Vite. Today I reached the file downloading feature. I do everything as usual, according to the instructions on the Remix.dev website. I did this earlier, with a remix development server and everything worked well.
But now, when I'm trying to upload the file, the vite-plugin-remix gives the error "ReferenceError: File is not defined". This happens because file "/node_modules/@remix-run/node/dist/upload/fileUploadHandler.js:143" contains class member creted from class "File". This member is not used. I just comment it and uploading was successful.
"File" is a class of a browser environment, so Vite knows nothing about it on the server. I ask you to fix this bug.
My project env is remix 2.8.0, with vite-plugin-remix and with typescript.
System Info
Used Package Manager
yarn
Expected Behavior
Uploading files with Vite and without error.
Actual Behavior
The text was updated successfully, but these errors were encountered: