When using tsx and pnpm, eleventy fails to run dev server (workaround included) #3353
Labels
feature: runtimes 👟 package managers ⚰️
Node.js, Deno, pnpm, et al.
needs-triage
release: canary
A release on the canary channel
typescript
Type definitions and Typescript issues
Operating system
Arch Linux
Eleventy
v3.0.0-alpha.14
Describe the bug
There has been plenty discussion and ongoing work around TypeScript support and pnpm support, (#577, #2876, #2849) to name a few, the last of which is an intersection of the two! Not mentioned; however, is this issue I encountered trying to use TSX templates following the docs, the advice in #577 (comment), and the docs-linked guide on the JetBrains website.
When running
npx tsx node_modules/.bin/eleventy --config=eleventy.config.ts --serve
I get:I am uncertain if pnpm swaps out executables, or whether
node_modules/.bin/eleventy
is supposed to contain:As TypeScript is getting official support and PRs regarding pnpm have been merged, I thought it might be helpful to mention this error, as it's elicited by using the commands in the 11ty docs.
The workaround was to use the
cmd.cjs
file directly, as is done in the JetBrains-posted guide I link to above:npx tsx node_modules/@11ty/eleventy/cmd.cjs --config=eleventy.config.ts --serve
It was a quick fix and I hope by posting here, I can save someone a headache :)
Reproduction steps
npm start
node_modules/.bin/eleventy
inpackage.json
withnode_modules/@11ty/eleventy/cmd.cjs
and rerunExpected behavior
Eleventy compiles the TSX and runs the dev server.
Reproduction URL
No response
Screenshots
No response
The text was updated successfully, but these errors were encountered: