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

[Bug]: .env file bypassed in debug mode 1.1.1 #30821

Closed
Fuut2000 opened this issue May 15, 2024 · 3 comments
Closed

[Bug]: .env file bypassed in debug mode 1.1.1 #30821

Fuut2000 opened this issue May 15, 2024 · 3 comments
Assignees

Comments

@Fuut2000
Copy link

Version

1.1.1

Steps to reproduce

log process.env in a test
start the test in normal mode: variables from .env are logged
start the test in debug mode: variables from .env are not logged (it worked in previous versions)

Expected behavior

variables from .env are logged in debug mode

Actual behavior

variables from .env are not logged

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 3.92 GB / 15.60 GB
  Binaries:
    Node: 20.8.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.89.1 - C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 4.4.20 - C:\WINDOWS\system32\bash.EXE
  npmPackages:
    @playwright/test: ^1.43.1 => 1.44.0
    playwright: 1.43 => 1.44.0
@pavelfeldman
Copy link
Member

How / where do you load the .env variables?

@Fuut2000
Copy link
Author

with globalSetup.js and the dotenv package:

import { config as _config } from "dotenv";

function globalSetup() {
_config({
path: ".env",
override: true,
});
}

export default globalSetup;

@mxschmitt mxschmitt removed the v1.44 label May 23, 2024
@pavelfeldman
Copy link
Member

That should be fixed now. Check out #30882 for more details. Also, please load your env in config, not in the global setup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants