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

How to launch app into launch.json #368

Open
maxime-aubry opened this issue Oct 11, 2023 · 1 comment
Open

How to launch app into launch.json #368

maxime-aubry opened this issue Oct 11, 2023 · 1 comment
Labels

Comments

@maxime-aubry
Copy link

maxime-aubry commented Oct 11, 2023

Hello.

I try to launch my React app using by launch.json for debugging into chrome

Here is the command line into package.json file :

"scripts": {
    "start": "env-cmd -f .env.a-env react-app-rewired start",
},

if i try to use any configuration into launch.json, environment variables are not read.

I tried this :

{
        "type": "node",
        "request": "launch",
        "name": "Launch with Node",
        "program": "${workspaceFolder}",
        "cwd": "${workspaceFolder}",
        "envFile": "${workspaceFolder}/.env.a-env",
}

And this too :

{
            "name": "Launch via npm",
            "type": "node",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "runtimeExecutable": "npm",
            "runtimeArgs": ["run-script", "start"]
}

And many other configurations.

Can you help me please ?

@toddbluhm
Copy link
Owner

Hey, so I am not super familiar with launch.json and how that all works. You appear to be using env-cmd correctly in your package.json file start script. Just make sure .env.a-env file exists and has a valid env file format.

If you're still having issues with this, let me know otherwise I will close this out if I don't hear a response.

@k-yle k-yle added the question label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants