← All tasks
javascriptmotdotla/dotenv #692Not a task: already works

dotenv not working in online editors (like Replit)

envgap__motdotla__dotenv-692

01 / FAILURE SIGNATURE

As reported upstream

Module not found: Error: Can't resolve 'fs' in pathto...Node_Modules\dotenv\main.js ..
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
463952012640a919a82be0de11f473c1224b498a
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

motdotla/dotenv #692 · read the original issue
When I start the frontend:



```bash

 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](https://replit.com/):



![image](https://user-images.githubusercontent.com/79479952/199960515-c0c5012e-f904-429c-b406-7b3af6e4fcf1.png)



I conducted a short search and found this [answer](https://stackoverflow.com/a/62011612), 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](https://github.com/motdotla/dotenv) community has to fix to avoid hacks like these.

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]