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

Debug CRA Tests stopped working on VSCode v1.19 #3602

Closed
amadeogallardo opened this issue Dec 15, 2017 · 5 comments
Closed

Debug CRA Tests stopped working on VSCode v1.19 #3602

amadeogallardo opened this issue Dec 15, 2017 · 5 comments

Comments

@amadeogallardo
Copy link
Contributor

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Which terms did you search for in User Guide?

Debug CRA Tests in VS Code
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code

Environment

  1. node -v: v8.9.1
  2. npm -v: 4.1.2
  3. yarn --version (if you use Yarn): No yarn
  4. npm ls react-scripts (if you haven’t ejected): -- (empty)

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version (if relevant): not relevant

Steps to Reproduce

  1. Open VS Code 1.19
  2. Setup a launch configuration as described here: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code
  3. Fire the debugger with F5 or play on the debugging panel
  4. The debugger doesn't start the test scripts and eventually fires a timeout
  5. Rollback to VSCode version 1.18
  6. Follow steps 1-2
  7. The debugger starts the test scripts and properly attaches to the debugger

Expected Behavior

Debug CRA Test launch configuration works on VSCode 1.19 (similar to VSCode 1.18).

No changes between VSCode versions, or an updated version of the documentation to setup the launch configuration.

Actual Behavior

  • The launch configuration doesn't start the test scripts
  • The debugger doesn't attach to the test process
  • Timeout error is thrown on VS Code

References

The changelog for VSCode 1.19 mentions new additions on the debugging experience: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code

Issue created on VSCode: microsoft/vscode#40293

@amadeogallardo
Copy link
Contributor Author

The VSCode team provided the correct configuration for launch.json. Apparently, the configuration documented on Create React App was working accidentaly due to a VS Code bug that was addressed on the latest version 1.19.

Here's the verified working code since VSCode 1.19, in case someone runs onto this. Let me know if you would like me to update the documentation (or if someone on the CRA team can do that).

{
    "name": "Debug CRA Tests",
    "type": "node",
    "request": "launch",
    "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
    "args": [
        "test",
        "--runInBand",
        "--no-cache",
        "--env=jsdom"
    ],
    "cwd": "${workspaceRoot}",
    "protocol": "inspector",
    "console": "integratedTerminal",
    "internalConsoleOptions": "neverOpen"
}

@Timer
Copy link
Contributor

Timer commented Dec 15, 2017

Please send a pull request fixing our documentation! 😄

amadeogallardo added a commit to amadeogallardo/create-react-app that referenced this issue Dec 15, 2017
The launch configuration code provided is not compatible with VSCode since version 1.19.
The proposed documentation change is based on the response by a VSCode team member.

References:
facebook#3602 (comment)
microsoft/vscode#40293 (comment)
Timer pushed a commit that referenced this issue Dec 18, 2017
The launch configuration code provided is not compatible with VSCode since version 1.19.
The proposed documentation change is based on the response by a VSCode team member.

References:
#3602 (comment)
microsoft/vscode#40293 (comment)
@pedro-mass
Copy link

Does this still work? Noticed the update in the ReadMe today, was excited to try it out: only to have the debugger not stop at the breakpoints 😢

@amadeogallardo
Copy link
Contributor Author

Does your environment match what's shown on the Issue description above?
If not: can you please post the environment settings that differ? E.g. VS Code version, node, etc.

@pedro-mass
Copy link

Turned out I needed Node@v8+
Older project, so I had to bump my .nvmrc file

nileshgulia1 pushed a commit to nileshgulia1/custom-react-scripts that referenced this issue Mar 11, 2018
The launch configuration code provided is not compatible with VSCode since version 1.19.
The proposed documentation change is based on the response by a VSCode team member.

References:
facebook/create-react-app#3602 (comment)
microsoft/vscode#40293 (comment)
rrdelaney pushed a commit to rrdelaney/reason-scripts that referenced this issue May 23, 2018
The launch configuration code provided is not compatible with VSCode since version 1.19.
The proposed documentation change is based on the response by a VSCode team member.

References:
facebook/create-react-app#3602 (comment)
microsoft/vscode#40293 (comment)
Coord pushed a commit to Azure/iot-ux-baseline that referenced this issue Jun 29, 2018
The launch configuration code provided is not compatible with VSCode since version 1.19.
The proposed documentation change is based on the response by a VSCode team member.

References:
facebook/create-react-app#3602 (comment)
microsoft/vscode#40293 (comment)
Pavek pushed a commit to Pavek/create-react-app that referenced this issue Jul 10, 2018
The launch configuration code provided is not compatible with VSCode since version 1.19.
The proposed documentation change is based on the response by a VSCode team member.

References:
facebook#3602 (comment)
microsoft/vscode#40293 (comment)
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants