Skip to content

docs: Update debugging markdown #523

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

Closed
wants to merge 1 commit into from

Conversation

tnovau
Copy link

@tnovau tnovau commented Mar 30, 2023

Hi, we were trying to debug cloud functions locally, using functions-framework. It seems that the doc is out of date, it doesn't work if you point to .bin folder

We were testing using:

  • Windows 10
  • node.js v18.12.1
  • cmd console

This is the output we were receiving when we tried to debug it in the way it was documented.

basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
←[90m    at Object.compileFunction (node:vm:360:18)←[39m
←[90m    at wrapSafe (node:internal/modules/cjs/loader:1088:15)←[39m
←[90m    at Module._compile (node:internal/modules/cjs/loader:1123:27)←[39m
←[90m    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:1037:32)←[39m
←[90m    at Module._load (node:internal/modules/cjs/loader:878:12)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m    at node:internal/main/run_main_module:23:47←[39m

Node.js v18.12.1

It's related to:

@google-cla
Copy link

google-cla bot commented Mar 30, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@tnovau tnovau changed the title Update debugging.md docs: Update debugging markdown to reflect a config that actually work Mar 30, 2023
@conventional-commit-lint-gcf
Copy link

conventional-commit-lint-gcf bot commented Mar 30, 2023

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@tnovau tnovau changed the title docs: Update debugging markdown to reflect a config that actually work docs: Update debugging markdown Mar 30, 2023
@tnovau
Copy link
Author

tnovau commented Apr 11, 2023

Hi @garethgeorge, do you mind reviewing this?

@kenneth-rosario kenneth-rosario added the blunderbuss: assign Instruct blunderbuss to assign someone label May 12, 2023
@blunderbuss-gcf blunderbuss-gcf bot removed the blunderbuss: assign Instruct blunderbuss to assign someone label May 12, 2023
@matthewrobertson
Copy link
Member

I just tested and the debugging works fine as documented. Perhaps there was an issue with your npm install?

@tnovau tnovau deleted the patch-1 branch April 27, 2024 23:46
@helgardferreira
Copy link

helgardferreira commented May 1, 2024

Can confirm that this is a problem when using pnpm specifically. I'm not sure if @tnovau was using pnpm though. I'm guessing it's because of how pnpm differs to npm when installing dependencies:

npm

ls -la node_modules/.bin | grep functions-framework
lrwxr-xr-x    1 xxx  staff    54 May  1 15:50 functions-framework -> ../@google-cloud/functions-framework/build/src/main.js
lrwxr-xr-x    1 xxx  staff    54 May  1 15:50 functions-framework-nodejs -> ../@google-cloud/functions-framework/build/src/main.js

pnpm

ls -la node_modules/.bin | grep functions-framework
-rwxr-xr-x   1 xxx  staff  2784 May  1 15:58 functions-framework
-rwxr-xr-x   1 xxx  staff  2784 May  1 15:58 functions-framework-nodejs

Note how npm (for node version v18.19.0) generates symbolically linked files for the executables in .bin whereas pnpm doesn't. Either way, the suggested change in this PR fixes the issue (for pnpm users at least).

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.

5 participants