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

docs(gatsby): add note to solve debugging build process on windows #20046

Merged
merged 2 commits into from Dec 16, 2019

Conversation

manutdkid77
Copy link
Contributor

Description

When trying to debug the build process using the VS Code Debugger on a Windows machine using the node --nolazy --inspect-brk node_modules/.bin/gatsby develop command mentioned in the docs, I get the following error:

$ node --nolazy --inspect-brk node_modules/.bin/gatsby develop
Debugger listening on ws://127.0.0.1:9229/2dab2d65-35db-4539-bb00-2f32bd25bd50
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
E:\Workspaces\hello-world\node_modules\.bin\gatsby:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at Module._compile (internal/modules/cjs/loader.js:721:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Waiting for the debugger to disconnect...

This error seems to appear only on Windows machines and can be resolved with the following command instead
node --nolazy --inspect-brk node_modules/gatsby/dist/bin/gatsby develop

@manutdkid77 manutdkid77 requested a review from a team as a code owner December 10, 2019 16:43
> **Note:** On machines running on Windows you may get an error such as
> `basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") SyntaxError: missing ) after argument list`
> A workaround is to run `node --nolazy --inspect-brk node_modules/gatsby/dist/bin/gatsby develop`.

Copy link
Contributor

@pieh pieh Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's, instead of adding a note, switch command we use in Line 73 to be one you propose in this note - it's functionally the same and this way we avoid the "problem" of files in node_modules/.bin being different on Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good approach.

Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the suggestion!

@wardpeet wardpeet merged commit dd155d5 into gatsbyjs:master Dec 16, 2019
@gatsbot
Copy link

gatsbot bot commented Dec 16, 2019

Holy buckets, @manutdkid77 — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. We’ve got Gatsby t-shirts, stickers, hats, scrunchies, and much more. (You can also unlock even more free swag with 5 contributions — wink wink nudge nudge.) See gatsby.dev/swag for details.
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

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

Successfully merging this pull request may close these issues.

None yet

4 participants