Title: node --watch bails on invalid import syntax · Issue #62022 · nodejs/node · GitHub
Open Graph Title: node --watch bails on invalid import syntax · Issue #62022 · nodejs/node
X Title: node --watch bails on invalid import syntax · Issue #62022 · nodejs/node
Description: Version 25 Platform Darwin Subsystem No response What steps will reproduce the bug? The module // index.mjs import Run node --watch . How often does it reproduce? Is there a required condition? always What is the expected behavior? Why i...
Open Graph Description: Version 25 Platform Darwin Subsystem No response What steps will reproduce the bug? The module // index.mjs import Run node --watch . How often does it reproduce? Is there a required condition? alw...
X Description: Version 25 Platform Darwin Subsystem No response What steps will reproduce the bug? The module // index.mjs import Run node --watch . How often does it reproduce? Is there a required condition? alw...
Opengraph URL: https://github.com/nodejs/node/issues/62022
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"node --watch bails on invalid import syntax","articleBody":"### Version\n\n25\n\n### Platform\n\n```text\nDarwin\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\n1. The module\n\n```js\n// index.mjs\nimport\n```\n\n2. Run\n\n```sh\nnode --watch .\n```\n\n### How often does it reproduce? Is there a required condition?\n\nalways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nWhat: Don't exit.\nWhy: Because it should watch.\n\n### What do you see instead?\n\nNode bails out with exit code `0`.\n\n```txt\n% node --watch .\nfile:/// ... /index.mjs:2\n\n\n\nSyntaxError: Unexpected end of input\n at compileSourceTextModule (node:internal/modules/esm/utils:357:16)\n at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:109:18)\n at #translate (node:internal/modules/esm/loader:564:20)\n at afterLoad (node:internal/modules/esm/loader:614:29)\n at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:619:12)\n at #createModuleJob (node:internal/modules/esm/loader:643:36)\n at #getJobFromResolveResult (node:internal/modules/esm/loader:353:34)\n at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:318:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:685:25)\n\nNode.js v25.0.0\nFailed running '.'. Waiting for file changes before restarting...\n```\n\n### Additional information\n\nSimilar to #62021","author":{"url":"https://github.com/valler","@type":"Person","name":"valler"},"datePublished":"2026-02-27T13:05:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/62022/node/issues/62022"}
| 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:1e804469-90bb-806a-158b-68b4cf5cbb06 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E214:227D33:2618B45:35F9FA7:6A4CE94A |
| html-safe-nonce | e62bbe181ceb3f3842cf6e405f08a2ac0197513d3a1cac822cc3f955d4a4554f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjE0OjIyN0QzMzoyNjE4QjQ1OjM1RjlGQTc6NkE0Q0U5NEEiLCJ2aXNpdG9yX2lkIjoiMTIzNjIyMDMzMTIxNjkyMjk1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 670bc94a23578f0208c6d2faa79b6aea0ea83a15413851042fbae58b2734d47d |
| hovercard-subject-tag | issue:4000950035 |
| 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/62022/issue_layout |
| twitter:image | https://opengraph.githubassets.com/58d6c9a1d392e1e0f4e653d909b415f296ca1916574b20d07de3c3841eec31f9/nodejs/node/issues/62022 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58d6c9a1d392e1e0f4e653d909b415f296ca1916574b20d07de3c3841eec31f9/nodejs/node/issues/62022 |
| og:image:alt | Version 25 Platform Darwin Subsystem No response What steps will reproduce the bug? The module // index.mjs import Run node --watch . How often does it reproduce? Is there a required condition? alw... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | valler |
| hostname | github.com |
| expected-hostname | github.com |
| None | 299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8 |
| 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 | c5a57f04eeb310f57c73fd6d751d957e2ca27ed2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width