motdotla / dotenv

Loads environment variables from .env for nodejs projects.
https://www.dotenvx.com
BSD 2-Clause "Simplified" License
19.01k stars 853 forks source link

2.0 Error: Dynamic require of "fs" is not supported #824

Open JoshuaGerke opened 4 months ago

JoshuaGerke commented 4 months ago

Error on using JS Module v2 and Dotenv

import 'dotenv/config';

[22:18:45][Error] Error: Dynamic require of "fs" is not supported at file:///C:/Users/Comma/Documents/ProjectReborn/server/altv/resources/gamemode/server/startup.js:39:9 at node_modules/dotenv/lib/main.js (file:///C:/Users/Comma/Documents/ProjectReborn/server/altv/resources/gamemode/server/startup.js:119:15) at __require2 (file:///C:/Users/Comma/Documents/ProjectReborn/server/altv/resources/gamemode/server/startup.js:42:50) at file:///C:/Users/Comma/Documents/ProjectReborn/server/altv/resources/gamemode/server/startup.js:424:3 at file:///C:/Users/Comma/Documents/ProjectReborn/server/altv/resources/gamemode/server/startup.js:431:3