decentraland / decentraland/creator-hub
[QA] Preview-failed toast exposes raw esbuild stack trace and internal error text on syntax errors
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 14
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 44
Description
### 🛠️ **Build version:**
0.44.0 (PR #1363, Bevy renderer branch)
### 📔 **Issue Description:**
When a scene has a build-time syntax error and Preview is triggered, Creator Hub correctly shows a "Failed to start preview. Check your scene code for errors." toast — but the toast also exposes the full raw esbuild stack trace, including local file system paths, instead of a clean, user-friendly message. Additionally, an internal developer-facing line (`Developer: All errors thrown must be an instance of "CliError"`) leaks into the output, and there is no dedicated "Open Code" / recovery action visible in the toast itself.
### 👣 **STR:**
1. Open a scene, enable Bevy Renderer
2. In `src/index.ts`, introduce a syntax error, e.g.:
```ts
const cube = engine.addEntity(
Transform.create(cube, { position: { x: 8, y: 1, z: 8 } })
MeshRenderer.setBox(cube)
```
3. Save, click Preview
### ✔️ **Expected Result:**
A concise, user-friendly error message (e.g. referencing the broken line/file) with a clear recovery action (e.g. "Open Code" / "Back"), without exposing raw stack traces, local file paths, or internal developer-facing error text.
### ❌ **Actual Result with evidence:**
Toast shows the full esbuild error including internal Node module file paths and a raw JS stack trace, plus the leaked line `Developer: All errors thrown must be an instance of "CliError"`. No dedicated recovery button is shown in the toast; the editor remains open/usable behind it, so no hard crash occurs.
Confirmed reproducing identically on both platforms:
- **macOS** (Apple M3 Pro): `src/index.ts:9:2: ERROR: Unexpected "}"`
- **Windows 11** (Intel i7-12650H, NVIDIA RTX 4060 Laptop GPU): `src/index.ts:5:0: ERROR: Expected ")" but found "MeshRenderer"`
### ➗ **Reproduction:**
##### 🔁 Always - (reproduced on both macOS and Windows)
#### 🖥️ **Operative system and additional Notes:**
Not platform-specific. Note: if a prior duplicate report of this exact issue is located, this one should be marked as a duplicate and closed in favor of the original.
Contributor guide
Assessment
This issue has not been assessed yet.