vercel-labs / vercel-labs/scriptc

Frontend rejects decorators with `SC0001: Decorators are not valid here.`

Open
#238 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.9k
Forks
125
Avg merge
2h 14m
Merged PRs (30d)
95

Description

Description

scriptc rejects decorator syntax with SC0001: Decorators are not valid here. instead of compiling it. This makes it impossible to build any codebase that relies on decorators — including NestJS apps, which use them pervasively for dependency injection, controllers, providers, and parameter injection.

In the case below, a standard NestJS constructor parameter decorator (@InjectPinoLogger from nestjs-pino) is rejected, even though it is valid TypeScript and compiles fine with tsc.

Minimal Demo
import { Injectable } from "@nestjs/common";
import { InjectPinoLogger, PinoLogger } from "nestjs-pino";

@Injectable()
export class FileValidationService {
  constructor(
    @InjectPinoLogger(FileValidationService.name)
    private readonly logger: PinoLogger,
  ) {}
}
Output
src/server/shared/modules/filesystem/file-validation.service.ts:31:5 - error SC0001: Decorators are not valid here.

  30 |   constructor(
  31 |     @InjectPinoLogger(FileValidationService.name)
     |     ^
  32 |     private readonly logger: PinoLogger,
Expected

Decorators should be supported (class, method, property, accessor, and parameter decorators), compiling to their equivalent runtime form and preserving metadata — matching TS experimentalDecorators + emitDecoratorMetadata semantics that frameworks like NestJS depend on.

If full decorator support is out of scope, the limitation should be clearly documented, since SC0001 currently blocks entire categories of TypeScript projects.

Environment
  • @scriptc/compiler version: 0.0.35
  • OS: MacOS
Notes

This same file compiles without errors under tsc with experimentalDecorators and emitDecoratorMetadata enabled.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the minimal TypeScript example with @scriptc/compiler 0.0.35 and compare its behavior with tsc using experimentalDecorators and emitDecoratorMetadata. Trace the compiler path that emits SC0001 for the constructor parameter decorator. Done means supported class, method, property, accessor, and parameter decorators compile with the required runtime metadata, or the limitation is documented if support is out of scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.