Skip to content

CRA to Vite migration, process is not defined error in 'mime-types' package. #111

@dethrtrns

Description

@dethrtrns

Hi there, I'm trying to migrate the project of my company where I work, from cra to Vite. Here's where I'm stuck:
Screenshot 2023-08-28 at 4 30 33 PM
Screenshot 2023-08-28 at 4 26 39 PM

I've checked out similar issues(all those issues have been marked as closed without any resolution) with other packages and all I got was a workaround of:
vitejs/vite#1973 (comment)
define: { 'process.env': {}, // to workaround the process.env error but not a permanent fix },
but it doesn't work in the production build, now it gives an error as the process is undefined!
I didn't face any such issues with other packages I'm using in the project.

Any help would be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions