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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,17 @@ Release notes are available on [github][notes].
12
12
13
13
-[fix] Replace `assert()` with explicit `if`/`throw` in `getInt()`, `getDouble()`, and `getBool()` so null-safety checks are enforced in release builds
14
14
- Error messages now include the variable name for easier debugging
15
+
-[fix]`load(isOptional: true)` no longer discards successfully loaded base file when an override file is missing or empty (fixes #70, #93, #101, #125)
16
+
-[fix]`clean()` now resets `isInitialized` to `false`, so accessing `env` after `clean()` correctly throws `NotInitializedError`
15
17
16
18
### Note on release-build behavior change
17
19
In **debug mode**, behavior is unchanged — `AssertionError` was thrown before, `AssertionError` is thrown now.
18
20
19
21
In **release mode**, calling `getInt()`, `getDouble()`, or `getBool()` with a missing variable and no fallback previously threw a `TypeError` (from the null-check operator `!`) because `assert()` was stripped. It now correctly throws `AssertionError` with a descriptive message. If your release-mode code catches `on TypeError` around these methods, update it to catch `on AssertionError` (or `on Error`) instead.
20
22
23
+
### Breaking change: `clean()` now resets initialization state
24
+
Previously, calling `clean()` only cleared the env map but left `isInitialized == true`. Now it also sets `isInitialized = false`. Code that calls `clean()` and then immediately accesses `dotenv.env` without reloading will now throw `NotInitializedError`. The fix is to call `load()` or `loadFromString()` again after `clean()`.
25
+
21
26
# 6.0.0
22
27
23
28
-[feat] Allow passing in override .env files on init
0 commit comments