Skip to content

Cannot deploy to cloudflare worker when using cloudflare vite / tanstack start (wasm bug?) #622

@devnomic

Description

@devnomic

Probably related to wasm

Repo Reproduction:
https://github.com/devnomic/cloudflare-worker-tanstack-restate-bug-repro

Check src/server.ts

Works on npm run dev, but when try to deploy npm run deploy. Cloudflare triggers errors.

  Uncaught TypeError: Cannot read properties of undefined (reading 'set_log_level')
    at null.<anonymous> (index.js:2244:8) in set_log_level
    at null.<anonymous> (index.js:1762:5) in GenericHandler
    at null.<anonymous> (index.js:4526:28) in handler
    at null.<anonymous> (index.js:4554:5) in createEndpointHandler
    at null.<anonymous> (index.js:9275:25)
   [code: 10021]
  To learn more about this error, visit:
  https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021

  
  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/workers-sdk/issues/new/choose

This repo is using tanstack which using cloudflare vite plugin, so i'm not sure which part reproducing this bug.

I tried the official example is using raw cloudflare worker / without vite, which is works.

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