Describe the bug
Since v8.35.0, the tsed-prisma generator binary is published without a shebang line, so prisma generate fails with shell syntax errors.
package.json maps the bin to an ESM file:
"bin": {
"tsed-prisma": "lib/esm/generator.js",
"tsed-prisma-esm": "lib/esm/generator.js"
}
Prisma resolves provider = "tsed-prisma" to node_modules/.bin/tsed-prisma and executes it directly. Without #!/usr/bin/env node the kernel has no interpreter directive, falls back to /bin/sh, and the shell tries to parse ESM as a shell script.
The first line of package/lib/esm/generator.js in each published tarball:
| Version |
First line |
| 8.34.0 |
#!/usr/bin/env node ✅ |
| 8.35.0 |
import { generate } from "./cli/prismaGenerator.js"; ❌ |
| 8.36.0 |
import { generate } from "./cli/prismaGenerator.js"; ❌ |
| 8.37.0 |
import { generate } from "./cli/prismaGenerator.js"; ❌ |
The bin mapping and the build script (rm -rf lib && yarn build:ts && monorepo build-hybrid) are identical between 8.34.0 and 8.35.0, so this looks like a change in build-tool output rather than an intentional config change. The import order at the top of the emitted file also changed between the two versions, which is consistent with a bundler/emit change dropping the shebang banner.
To Reproduce
Verify directly from the published tarballs, no project required:
for v in 8.34.0 8.35.0 8.36.0 8.37.0; do
curl -sL "$(npm view @tsed/prisma@$v dist.tarball)" -o "ver-$v.tgz"
printf "%-8s %s\n" "$v" "$(tar -xzOf "ver-$v.tgz" package/lib/esm/generator.js | head -1)"
done
In a project:
- Install
@tsed/prisma@8.37.0.
- Add to
schema.prisma:
generator tsed {
provider = "tsed-prisma"
}
- Run
prisma generate.
Result:
Error: Generator "tsed-prisma" failed:
node_modules/.bin/tsed-prisma: line 1: import: command not found
node_modules/.bin/tsed-prisma: line 2: import: command not found
node_modules/.bin/tsed-prisma: line 3: import: command not found
node_modules/.bin/tsed-prisma: line 4: const: command not found
node_modules/.bin/tsed-prisma: line 4: //: is a directory
node_modules/.bin/tsed-prisma: line 5: syntax error near unexpected token `('
node_modules/.bin/tsed-prisma: line 5: `export const defaultOutput = join(rootDir, "..", ".schema");'
Pinning @tsed/prisma back to 8.34.0 resolves it.
Expected behavior
lib/esm/generator.js keeps its #!/usr/bin/env node shebang when published, so the tsed-prisma bin is executable by Prisma as it was through 8.34.0.
OS
macOS 26.5.2 (also applies to any POSIX platform, since the failure is in shebang resolution)
Node version
v24.13.0
Library version
@tsed/prisma 8.35.0 – 8.37.0 (regression introduced in 8.35.0; 8.34.0 works)
Additional context
Adjacent versions: prisma 7.8.0, Yarn 4.17.0 (node-modules linker).
Workarounds for anyone hitting this before a fix lands:
- pin
@tsed/prisma to 8.34.0, or
- invoke the generator through node instead of the bin name:
generator tsed {
provider = "node node_modules/@tsed/prisma/lib/esm/generator.js"
}
Describe the bug
Since
v8.35.0, thetsed-prismagenerator binary is published without a shebang line, soprisma generatefails with shell syntax errors.package.jsonmaps the bin to an ESM file:Prisma resolves
provider = "tsed-prisma"tonode_modules/.bin/tsed-prismaand executes it directly. Without#!/usr/bin/env nodethe kernel has no interpreter directive, falls back to/bin/sh, and the shell tries to parse ESM as a shell script.The first line of
package/lib/esm/generator.jsin each published tarball:#!/usr/bin/env node✅import { generate } from "./cli/prismaGenerator.js";❌import { generate } from "./cli/prismaGenerator.js";❌import { generate } from "./cli/prismaGenerator.js";❌The
binmapping and thebuildscript (rm -rf lib && yarn build:ts && monorepo build-hybrid) are identical between 8.34.0 and 8.35.0, so this looks like a change in build-tool output rather than an intentional config change. The import order at the top of the emitted file also changed between the two versions, which is consistent with a bundler/emit change dropping the shebang banner.To Reproduce
Verify directly from the published tarballs, no project required:
In a project:
@tsed/prisma@8.37.0.schema.prisma:prisma generate.Result:
Pinning
@tsed/prismaback to8.34.0resolves it.Expected behavior
lib/esm/generator.jskeeps its#!/usr/bin/env nodeshebang when published, so thetsed-prismabin is executable by Prisma as it was through 8.34.0.OS
macOS 26.5.2 (also applies to any POSIX platform, since the failure is in shebang resolution)
Node version
v24.13.0
Library version
@tsed/prisma 8.35.0 – 8.37.0 (regression introduced in 8.35.0; 8.34.0 works)
Additional context
Adjacent versions:
prisma7.8.0, Yarn 4.17.0 (node-modules linker).Workarounds for anyone hitting this before a fix lands:
@tsed/prismato8.34.0, or