Retool CLI bug - missing types

**Subject:** `retool check` typecheck fails: local `useBackendFunction` stub is missing `dataAccessErrors`

**Summary**

In a code-based app, `retool check` fails the typecheck phase (and so blocks `retool push`). The cause is the local stand-in hook that the CLI writes. The generated `use` hooks are documented to return `dataAccessErrors`, but the stub's return type does not include it, so any code that reads `dataAccessErrors` fails to type-check. The build phase passes.

**Environment**

- Retool CLI 0.4.106 (launcher 0.1.10). `retool update` reports this is up to date with our instance.

- Instance:

- App UUID:

- Node v22.23.2 , pnpm 10.34.6, macOS (Apple Silicon)

**Steps to reproduce**

1. In a code-based app, use a generated hook and read `dataAccessErrors`:

```tsx

const usersQuery = useGetUsers()

usersQuery.dataAccessErrors.map((e) => e.message)

```

2. Run `retool check`.

**Expected**

Typecheck passes. The header of each generated file in `frontend/hooks/backend/*.ts` says:

> Each hook returns `{ data, loading, error, dataAccessErrors, trigger }`

**Actual**

```

✓ hooks: passed

✓ validate: passed

✗ typecheck: TypeScript reported type errors.

✓ build: passed

✗ check: one or more required phases failed

frontend/pages/Users.tsx(108,17): error TS2339: Property 'dataAccessErrors' does not exist on type '{ data: any; loading: boolean; error: string | null; trigger: (params?: Record<string, unknown> | undefined, options?: { skipCache?: boolean; } | undefined) => any; }'.

frontend/pages/Users.tsx(109,64): error TS7006: Parameter 'e' implicitly has an 'any' type.

```

In our app this produces about 40 errors across 17 files, all with the same cause.

**Cause**

`frontend/hooks/useBackendFunction.ts`, generated by `retool init` / `check` / `start`, declares:

```ts

): {

data: any

loading: boolean

error: string | null

trigger: (params?: Record<string, unknown>, options?: { skipCache?: boolean }) => any

}

```

`dataAccessErrors` is missing. The runtime does return it: `frontend/hooks/consumeExecuteStream.ts` parses `dataAccessErrors` from the response.

**Suggested fix**

Add `dataAccessErrors: { message: string }[]` to the stub's return type and return `dataAccessErrors: []` from the stub.

**Impact**

`retool push` runs `retool check` first, so we can't push from a local checkout. Editing the stub doesn't help, because the CLI regenerates it on every run.

Summary

In a code-based (new app builder) app using Retool CLI 0.4.106, retool check fails its typecheck phase because the locally generated frontend/hooks/useBackendFunction.ts stub omits dataAccessErrors from its return type, even though the generated hooks are documented to return it and the runtime does return it — which blocks retool push.

AI Response

This is a credible, self-contained report of a mismatch between the CLI-generated stub's return type and the documented/runtime hook shape, and no public forum post or documentation page currently corroborates it or offers a confirmed fix. Because the CLI regenerates the stub on every run, editing it directly won't persist, as noted. As a temporary local mitigation to get past the typecheck phase, you can avoid reading the untyped property directly — for example by narrowing with a cast or optional access (e.g. (usersQuery as any).dataAccessErrors ?? [] and explicitly typing the map parameter) — though this is a workaround rather than a resolution of the underlying stub-generation gap. No matching community report, workaround, status incident, or changelog fix was found, so there are no directly relevant public resources to cite at this time.

Sources

The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a :heart:, :+1:, or :-1:. Or by marking this post as the "Solution"! Let us know if you have any feedback here. :rocket:

1 Like

Hi @Mike_Broders, thanks for the detailed report. This is a confirmed bug, and a fix is in progress. I'll update this thread once it's released!

1 Like

Hello again @Mike_Broders, the fix is now released in Retool Cloud 4.74.0 :partying_face:
Re-run retool check and the dataAccessErrors type errors should be gone. Let me know if you still see them!

1 Like

thank you! this is working as expected now. :+1:

1 Like