Skip to content

inline-mod: kill the CLI with a nicer error message #212

@ArmandPhilippot

Description

@ArmandPhilippot

inline-mod doesn't support HMR so the Astro dev server will crash if a file is updated. Example of logs:

TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received undefined
    at Module.relative (node:path:1287:5)
    at findModuleEntry (file:///project/node_modules/.pnpm/@inox-tools+inline-mod@2.0.3_vite@6.2.3_@types+node@22.13.13_/node_modules/@inox-tools/inline-mod/dist/chunk-WP5NI5SC.js:1760:35)
    at async Inspector.inspectComplex (file:///project/node_modules/.pnpm/@inox-tools+inline-mod@2.0.3_vite@6.2.3_@types+node@22.13.13_/node_modules/@inox-tools/inline-mod/dist/chunk-WP5NI5SC.js:1339:25)
    at async Inspector.unsafeInspect (file:///project/node_modules/.pnpm/@inox-tools+inline-mod@2.0.3_vite@6.2.3_@types+node@22.13.13_/node_modules/@inox-tools/inline-mod/dist/chunk-WP5NI5SC.js:1262:19)
    at async Inspector.inspect (file:///project/node_modules/.pnpm/@inox-tools+inline-mod@2.0.3_vite@6.2.3_@types+node@22.13.13_/node_modules/@inox-tools/inline-mod/dist/chunk-WP5NI5SC.js:1210:14)
    at async inspectInlineMod (file:///project/node_modules/.pnpm/@inox-tools+inline-mod@2.0.3_vite@6.2.3_@types+node@22.13.13_/node_modules/@inox-tools/inline-mod/dist/vite.js:466:20)

Node.js v22.14.0
 ELIFECYCLE  Command failed with exit code 1.

This error message is not really helpful for the consumer, so it would be nice to have a way to kill the CLI in such a case with a nicer error message (ie. the dev server must be restarted, so we're killing it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions