Title: CLI --eval rejects valid trailing line comments when input contains crypto · Issue #67159 · nodejs/node · GitHub
Open Graph Title: CLI --eval rejects valid trailing line comments when input contains crypto · Issue #67159 · nodejs/node
X Title: CLI --eval rejects valid trailing line comments when input contains crypto · Issue #67159 · nodejs/node
Description: Node.js version and platform Node.js v26.12.1, macOS arm64. Reproduced with the Node executable directly; no packages or application setup are needed. Reproduction Run: node -e 'crypto; // comment' The command exits with status 1. It rep...
Open Graph Description: Node.js version and platform Node.js v26.12.1, macOS arm64. Reproduced with the Node executable directly; no packages or application setup are needed. Reproduction Run: node -e 'crypto; // comment'...
X Description: Node.js version and platform Node.js v26.12.1, macOS arm64. Reproduced with the Node executable directly; no packages or application setup are needed. Reproduction Run: node -e 'crypto; // comm...
Opengraph URL: https://github.com/nodejs/node/issues/67159
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CLI --eval rejects valid trailing line comments when input contains crypto","articleBody":"### Node.js version and platform\n\nNode.js v26.12.1, macOS arm64. Reproduced with the Node executable directly; no packages or application setup are needed.\n\n### Reproduction\n\nRun:\n\n```sh\nnode -e 'crypto; // comment'\n```\n\nThe command exits with status 1. It reports this generated source and error:\n\n```text\n(crypto=>{{crypto; // comment}})(require('node:crypto'))\nSyntaxError: Unexpected end of input\n```\n\nThe same failure occurs with `--input-type=commonjs`. These controls both exit successfully:\n\n```sh\nnode -e 'crypto;'\nnode -e 'crypto; /* comment */'\n```\n\nAdding a newline after the line comment also succeeds.\n\n### Expected behavior\n\nThe original command should exit successfully. Its input is valid JavaScript; the trailing line comment should not consume code inserted by the CLI. This affects command generators or scripts that append a line comment to an otherwise valid `--eval` input containing `crypto`.\n\n### Source evidence\n\nIn [eval_string.js at v26.12.1](https://github.com/nodejs/node/blob/v26.12.1/lib/internal/main/eval_string.js), the crypto compatibility branch inserts the input into a wrapper without a newline before the closing syntax. The error above shows that closing syntax on the commented line. This is a standalone CLI reproduction, not a production-incident claim.\n","author":{"url":"https://github.com/CaliLuke","@type":"Person","name":"CaliLuke"},"datePublished":"2026-10-31T11:33:06Z","url":"https://github.com/nodejs/node/issues/67159"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cd2873f3-3712-bfdb-9a3f-7be88560f391 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E586:4C535:AB5643:E5F0C9:6B0641A3 |
| html-safe-nonce | 48aa7d453b54dc0622d0a48ccea867ffb4b4d100fadb34aa704421b9f289ebee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTg2OjRDNTM1OkFCNTY0MzpFNUYwQzk6NkIwNjQxQTMiLCJ2aXNpdG9yX2lkIjoiNzc2ODE3MzgzNjcxNzQwODY3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0416f4eec92924bc7a7e7ae14d53bfb6593c963fc7b924b48bc1b95799e2e75b |
| hovercard-subject-tag | issue:6134319390 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67159/issue_layout |
| twitter:image | https://opengraph.githubassets.com/df6b52bf44aa9493ac85540c75d2d5de9bcf512b766953ef1e65f7c50bd96c03/nodejs/node/issues/67159 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/df6b52bf44aa9493ac85540c75d2d5de9bcf512b766953ef1e65f7c50bd96c03/nodejs/node/issues/67159 |
| og:image:alt | Node.js version and platform Node.js v26.12.1, macOS arm64. Reproduced with the Node executable directly; no packages or application setup are needed. Reproduction Run: node -e 'crypto; // comment'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CaliLuke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width