software-mansion / software-mansion/TypeGPU

impr: More descriptive errors when defining variable of unknown type

Open
#1,991 0 comments 0 reactions 1 assignee View on GitHub

@cieplypolar is already working on this.

Since Dec 18, 2025.

Dominant language
TypeScript
Stars
3.2k
Forks
122
Avg merge
3d 5h
Merged PRs (30d)
34

Description

Currently:

const getArr = tgpu['~unstable'].comptime(() => d.arrayOf(d.f32, 2)([1, 2]));
cosnt f = () => {
  'use gpu';
  const arr = getArr();
};

It will throw error "Tried to define variable 'arr' of unknown type".
The same will happen for d.struct.

We can throw more descriptive error with suggestion what to change.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.