Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Maximum call stack size exceeded when a .env file has environment variable with default values #3478

Closed
6 tasks done
hgouveia opened this issue May 31, 2023 · 4 comments
Labels

Comments

@hgouveia
Copy link

Describe the bug

if you have a .env file in your project and this has environment variable with default values, you will get this error

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
RangeError: Maximum call stack size exceeded
    at RegExp.exec (<anonymous>)
    at file://test-app/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:36830:54
    at Array.reduce (<anonymous>)
    at _interpolate (file://test-app/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:36829:18)
    at file://test-app/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:36863:15
    at Array.reduce (<anonymous>)
    at _interpolate (file://test-app/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:36829:18)
    at file://test-app/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:36863:15
    at Array.reduce (<anonymous>)
    at _interpolate (file://test-app/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:36829:18)

this only happened to me in Linux and my ci with docker, this does not happen on windows (my main machine)

Reproduction

  • create a empty project npm init -y
  • install vitest
  • create a .env file with this content
MY_SECRET=${MY_SECRET:-}
  • run npx vitest run

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 29.10 GB / 31.31 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - /mnt/d/programas/nodejs/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
  npmPackages:
    vitest: ^0.31.2 => 0.31.2

Used Package Manager

npm

Validations

@sheremet-va
Copy link
Member

This looks like an issue with Vite. I recommend opening an issue in their repo.

@hgouveia
Copy link
Author

hgouveia commented Jun 1, 2023

This looks like an issue with Vite. I recommend opening an issue in their repo.

in my particular case, i am not using Vite or installed it, i just installed vitest, is this still applies?

@sheremet-va
Copy link
Member

This looks like an issue with Vite. I recommend opening an issue in their repo.

in my particular case, i am not using Vite or installed it, i just installed vitest, is this still applies?

Yes, Vitest uses Vite internally. It's basically a wrapper around Vite.

@hgouveia
Copy link
Author

hgouveia commented Jun 1, 2023

This looks like an issue with Vite. I recommend opening an issue in their repo.

in my particular case, i am not using Vite or installed it, i just installed vitest, is this still applies?

Yes, Vitest uses Vite internally. It's basically a wrapper around Vite.

thanks, created ticket on : vitejs/vite#13399

@hgouveia hgouveia closed this as completed Jun 1, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants