Skip to content

Commit

Permalink
Update packages/vite/src/node/env.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
  • Loading branch information
Dunqing and benmccann committed Dec 2, 2022
1 parent 3a3875d commit 21d91ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/node/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export function loadEnv(
// let environment variables use each other
expandParsed = expand(expandOptions).parsed!
} catch (e) {
// custom error handling until https://github.com/motdotla/dotenv-expand/issues/65 is fixed upstream
// check for message "TypeError: Cannot read properties of undefined (reading 'split')"
if (e.message.includes('split')) {
throw new Error(
'dotenv-expand failed to expand env vars. Maybe you need to escape `$`?'
Expand Down

0 comments on commit 21d91ee

Please sign in to comment.