playcanvas / playcanvas/editor

Better messaging for when script attribute parsing fails

Open
#148 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: scripts area: ui bug
Dominant language
TypeScript
Stars
1.3k
Forks
215
Avg merge
1d 29m
Merged PRs (30d)
30

Description

There is an issue with script attributes parsing, leading to some errors in editor. Seems like regression since JSON schema been introduced.

Steps to Reproduce
  1. Create new blank project
  2. Create new script test.js
  3. Paste this code into it:
var Test = pc.createScript('test');

Test.attributes.add('chunk', {
    name: 'shader',
    type: 'asset',
    description: 'test'
});
  1. In Editor, select test.js asset
  2. Hit "Parse" in Inspector few times.
Issue:

Look in console, it failed to update data of that script attributes in underlying data (Observer), due to schema issues. It might be that the path for field it tries to set for attribute - is wrong.

Contributor guide

Open the contributing guide

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

Reproduce the issue with the test.js script from the steps, select it in the Editor Inspector, and press Parse while watching the console. Trace the script-attribute parsing and Observer update path to determine why the schema path fails; done means parsing produces an appropriate message and updates the underlying attribute data correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.