Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Asset attributes no longer supported

Aperta
#75 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
devtools

Direzione di ricerca

The bug is that JSDoc @type {Asset} and @type {Entity} are rejected by the attribute parser, with the error listing only Curve, Vec2, Vec3, Vec4, Color, number, string and boolean. Search the TypeScript source for that error text and for the list of accepted attribute types, then check the 2.22.6 history to see how these types were handled before. Run the minimal script from the issue to reproduce. Done means that Asset and Entity attributes parse again, with a test covering them.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Asset attributes worked in 2.22.6 but no longer work in 2.23.2+.

Minimal script:

import { Script, Asset, Entity } from 'playcanvas';

export class AssetAttr extends Script {
    static scriptName = 'assetAttr';

    /**
     * @attribute
     * @type {Asset}
     */
    myAsset = null;

    /**
     * @attribute
     * @type {Entity}
     */
    myEntity = null;
}

Editor shows an error:

broken-attribute.mjs:8:14 - (myAsset) "{Asset}" is not a valid attribute type. An attribute should be one of the following: Curve, Vec2, Vec3, Vec4, Color, number, string, boolean

Lingua principale
TypeScript
Stelle
1
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di playcanvas/attribute-parser

Tutte le issue di playcanvas/attribute-parser

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.