Frontend rejects decorators with `SC0001: Decorators are not valid here.`
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- compilers
Hướng nghiên cứu
Bắt đầu bằng cách tái tạo ví dụ TypeScript tối thiểu với @scriptc/compiler 0.0.35 và so sánh hành vi của nó với tsc khi sử dụng experimentalDecorators và emitDecoratorMetadata. Truy vết đường dẫn của compiler phát ra SC0001 cho decorator của tham số constructor. Công việc được xem là hoàn tất khi các decorator được hỗ trợ của class, method, property, accessor và parameter biên dịch với metadata runtime cần thiết, hoặc khi giới hạn này được ghi lại nếu việc hỗ trợ nằm ngoài phạm vi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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/compilerversion: 0.0.35- OS: MacOS
Notes
This same file compiles without errors under tsc with experimentalDecorators and emitDecoratorMetadata enabled.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.7k
- Fork
- 229
- Merge trung bình
- 14 giờ 29 phút
- Pull request đã merge (30 ngày)
- 787
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vercel-labs/scriptc
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
vercel-labs/scriptc#4865 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
vercel-labs/scriptc#4864 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows ARM64 as a cross-compile targetCó thể đã có người làm @hum-n đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
vercel-labs/scriptc#4858 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
post-merge-bisect-unresolved
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 43/100
vercel-labs/scriptc#4791 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
post-merge-bisect-unconfirmed
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
vercel-labs/scriptc#4755 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel-labs/scriptc
Issue tương tự
-
bug data-types
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: middleware enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
agent/quality testing
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
juspay/agent-distro#203 ·
Maintainer thường phản hồi trong vòng 1 ngày