Skip to content

cf-generate step #3

@dcsan

Description

@dcsan

stack looks great and tx for the video.

but on first build i get these errors, think cos of the missing step to generate cf types.
you won't see this on just a dev run

pnpm run build

> react-on-workers-with-assets@0.0.0 build /Users/dc/dev/hacks/stacks/backpine
> tsc -b && vite build

worker/trpc/context.ts:7:8 - error TS2304: Cannot find name 'Env'.

7   env: Env;
         ~~~

worker/trpc/context.ts:8:14 - error TS2304: Cannot find name 'ExecutionContext'.

8   workerCtx: ExecutionContext;
               ~~~~~~~~~~~~~~~~


Found 2 errors.

so i had to
pnpm run cf-typegen

then I had to add this at the top of worker/trpc/context.ts

/// <reference types="../../worker-configuration.d.ts" />

it references a cf-generated file that wasn't in the repo, not sure if that should be committed.

is that the best way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions