Skip to content

dotenv not working in online editors (like Replit) #692

@chadnpc

Description

@chadnpc

When I start the frontend:

 npm run start

I get:

Module not found: Error: Can't resolve 'fs' in pathto...Node_Modules\dotenv\main.js ..

Note: This error does not happen when running on my local Pc.

Here's the screenshot from running the same app on replit:

image

I conducted a short search and found this answer, which helped me repair issue by modifying the "./node modules/dotenv/Package.json" file.

It worked, the error was fixed!, but I don't understand why ?!😂, so I'm guessing this is a problem that the dotenv community has to fix to avoid hacks like these.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions