Version: Deno 2.8.3
Summary
When you import a Deno workspace, and pass that file to a node cli (jiti for example) through a deno task, the cli will not be able to resolve the workspace module. This is super frustrating for monorepo's that depend on a package exposed cli to generate code based on a .ts config. I would like to avoid having to use a seperate package.json for this module.
Reproduction
deno.json:
{
"tasks": {
"auth:generate": "auth generate --config ../auth/src/auth.ts --y --output ./src/auth.schema.ts"
},
"nodeModulesDir": "auto"
}
auth.ts
import { env } from "@workspace/env/server"
Then run:
deno task auth:generate
Expected behavior
The script should be able to read the auth.ts file without a problem
Actual behaviour
[#better-auth]: Couldn't read your auth config. Error: Cannot find module '@workspace/env/server'
Why this matters
When a package exposes a CLI, the CLI cannot be used because the module is not symlinked into a node_modules folder.
Version: Deno 2.8.3
Summary
When you import a Deno workspace, and pass that file to a node cli (jiti for example) through a deno task, the cli will not be able to resolve the workspace module. This is super frustrating for monorepo's that depend on a package exposed cli to generate code based on a .ts config. I would like to avoid having to use a seperate package.json for this module.
Reproduction
deno.json:
auth.ts
import { env } from "@workspace/env/server"Then run:
deno task auth:generateExpected behavior
The script should be able to read the
auth.tsfile without a problemActual behaviour
[#better-auth]: Couldn't read your auth config. Error: Cannot find module '@workspace/env/server'Why this matters
When a package exposes a CLI, the CLI cannot be used because the module is not symlinked into a node_modules folder.