bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Unexpected token '.' on bru run

Open fcd-middleway opened this issue 1 year ago • 1 comments

I have checked the following:

  • [X] I use the newest version of bruno.
  • [X] I've searched existing issues and found nothing related to my issue.

Describe the bug

Hello,

After installing bru cli (1.14.0) with npm (10.6.0), I run the following commande "bru run".

And I've got the following error :

`(node:64892) UnhandledPromiseRejectionWarning: /usr/local/lib/node_modules/@usebruno/cli/src/commands/run.js:134 const requestHasTests = bruJson.request?.tests; ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:1054:16) at Module._compile (internal/modules/cjs/loader.js:1102:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Module.require (internal/modules/cjs/loader.js:1026:19) at Object.require (internal/modules/cjs/helpers.js:72:18) at /usr/local/lib/node_modules/@usebruno/cli/node_modules/require-directory/index.js:76:17 at Array.forEach () at Object.requireDirectory (/usr/local/lib/node_modules/@usebruno/cli/node_modules/require-directory/index.js:59:24) (node:64892) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:64892) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. `

The command is run in the same folder than the bruno.json file at the root of my collection. I have at least one .bru file in the subfolders. In this .bru file, there are several tests and one assertion.

Do you have any idea of what could have going wrong there ?

Thanks.

.bru file to reproduce the bug

No response

Screenshots/Live demo link

image

fcd-middleway avatar Apr 30 '24 16:04 fcd-middleway

Try to use tripple backticks to get a codeblock in markdown in your issue ticket above.

melroy89 avatar Apr 30 '24 20:04 melroy89

I've change this.

fcd-middleway avatar May 02 '24 06:05 fcd-middleway

Hello,

Any idea for this issue ?

fcd-middleway avatar May 06 '24 07:05 fcd-middleway

Hello,

Any idea for this issue ?

Your node version might be too old. What version are you using? Make sure it's version 18+

Its-treason avatar May 06 '24 07:05 Its-treason

Thank you, that was just that.

fcd-middleway avatar May 06 '24 10:05 fcd-middleway