Temp repo to document problems with workers-rs

Overview

This is a temporarily repo to share some worker-rs code that is giving me problems. See also: https://github.com/cloudflare/workers-rs/issues/94

Version info

rustc 1.58.0-nightly (936238a92 2021-11-11)
wrangler 1.19.5

Reproduction transcripts:

Build:

$ wrangler build
🌀  Running cargo install -q worker-build && worker-build --release
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished release [optimized] target(s) in 0.28s
[INFO]: Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: :-) Done in 7.63s
[INFO]: :-) Your wasm pkg is ready to publish at /nas/achin/devel/id_counter_cfw/build.
✨  Build completed successfully!

Run:

$ wrangler dev
🌀  Running cargo install -q worker-build && worker-build --release
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished release [optimized] target(s) in 0.25s
[INFO]: Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: :-) Done in 8.38s
[INFO]: :-) Your wasm pkg is ready to publish at /nas/achin/devel/id_counter_cfw/build.
👂  Listening on http://127.0.0.1:8787

Test with curl:

curl http://127.0.0.1:8787

(Curl returned an HTML error page, but I'm not reproducing it here)

Complete output from the wrangler dev terminal:

$ wrangler dev
🌀  Running cargo install -q worker-build && worker-build --release
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished release [optimized] target(s) in 0.25s
[INFO]: Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: :-) Done in 8.38s
[INFO]: :-) Your wasm pkg is ready to publish at /nas/achin/devel/id_counter_cfw/build.
👂  Listening on http://127.0.0.1:8787
TypeError: Fetch API cannot load: /test
panicked at 'TypeError: Fetch API cannot load: /test', src/lib.rs:43:1

Stack:

Error
    at __wbg_new_693216e109162396 (./index_bg.mjs:368:15)
    at wasm://wasm/00194036:wasm-function[156]:0x1ff5c
    at wasm://wasm/00194036:wasm-function[596]:0x2b3b1
    at wasm://wasm/00194036:wasm-function[211]:0x23c5b
    at wasm://wasm/00194036:wasm-function[290]:0x26f3d
    at wasm://wasm/00194036:wasm-function[439]:0x2a387
    at wasm://wasm/00194036:wasm-function[466]:0x2a899
    at wasm://wasm/00194036:wasm-function[422]:0x29f0f
    at wasm://wasm/00194036:wasm-function[116]:0x1c1ee
    at wasm://wasm/00194036:wasm-function[268]:0x26321


RuntimeError: unreachable
    at wasm://wasm/00194036:wasm-function[211]:0x23c91
    at wasm://wasm/00194036:wasm-function[290]:0x26f3d
    at wasm://wasm/00194036:wasm-function[439]:0x2a387
    at wasm://wasm/00194036:wasm-function[466]:0x2a899
    at wasm://wasm/00194036:wasm-function[422]:0x29f0f
    at wasm://wasm/00194036:wasm-function[116]:0x1c1ee
    at wasm://wasm/00194036:wasm-function[268]:0x26321
    at wasm://wasm/00194036:wasm-function[135]:0x1e12f
    at wasm://wasm/00194036:wasm-function[259]:0x25dd8
    at wasm://wasm/00194036:wasm-function[231]:0x24bca at line 0, col 146576
{
  "exceptionDetails": {
    "columnNumber": 146576,
    "exception": {
      "className": "RuntimeError",
      "description": "RuntimeError: unreachable\n    at wasm://wasm/00194036:wasm-function[211]:0x23c91\n    at wasm://wasm/00194036:wasm-function[290]:0x26f3d\n    at wasm://wasm/00194036:wasm-function[439]:0x2a387\n    at wasm://wasm/00194036:wasm-function[466]:0x2a899\n    at wasm://wasm/00194036:wasm-function[422]:0x29f0f\n    at wasm://wasm/00194036:wasm-function[116]:0x1c1ee\n    at wasm://wasm/00194036:wasm-function[268]:0x26321\n    at wasm://wasm/00194036:wasm-function[135]:0x1e12f\n    at wasm://wasm/00194036:wasm-function[259]:0x25dd8\n    at wasm://wasm/00194036:wasm-function[231]:0x24bca",
      "preview": {
        "description": "RuntimeError: unreachable\n    at wasm://wasm/00194036:wasm-function[211]:0x23c91\n    at wasm://wasm/00194036:wasm-function[290]:0x26f3d\n    at wasm://wasm/00194036:wasm-function[439]:0x2a387\n    at wasm://wasm/00194036:wasm-function[466]:0x2a899\n    at wasm://wasm/00194036:wasm-function[422]:0x29f0f\n    at wasm://wasm/00194036:wasm-function[116]:0x1c1ee\n    at wasm://wasm/00194036:wasm-function[268]:0x26321\n    at wasm://wasm/00194036:wasm-function[135]:0x1e12f\n    at wasm://wasm/00194036:wasm-function[259]:0x25dd8\n    at wasm://wasm/00194036:wasm-function[231]:0x24bca",
        "entries": null,
        "overflow": false,
        "properties": [
          {
            "name": "stack",
            "subtype": null,
            "type": "string",
            "value": "RuntimeError: unreachable\n    at wasm://wasm/00194…t wasm://wasm/00194036:wasm-function[231]:0x24bca",
            "valuePreview": null
          },
          {
            "name": "message",
            "subtype": null,
            "type": "string",
            "value": "unreachable",
            "valuePreview": null
          }
        ],
        "subtype": "error",
        "type": "object"
      },
      "subtype": "error",
      "type": "object",
      "value": null
    },
    "lineNumber": 0,
    "text": "Uncaught (in promise)",
    "url": "wasm://wasm/00194036"
  },
  "timestamp": 1638831246179
}
A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's request context have already finished.
Error: The script will never generate a response. at line 0, col -2
{
  "exceptionDetails": {
    "columnNumber": -2,
    "exception": {
      "className": "Error",
      "description": "Error: The script will never generate a response.",
      "preview": {
        "description": "Error: The script will never generate a response.",
        "entries": null,
        "overflow": false,
        "properties": [
          {
            "name": "stack",
            "subtype": null,
            "type": "string",
            "value": "Error: The script will never generate a response.",
            "valuePreview": null
          },
          {
            "name": "message",
            "subtype": null,
            "type": "string",
            "value": "The script will never generate a response.",
            "valuePreview": null
          }
        ],
        "subtype": "error",
        "type": "object"
      },
      "subtype": "error",
      "type": "object",
      "value": null
    },
    "lineNumber": 0,
    "text": "Uncaught (in response)",
    "url": "undefined"
  },
  "timestamp": 1638831246179
}
[2021-12-06 17:54:09] GET id_counter_cfw.em32.workers.dev/ HTTP/1.1 500 Internal Server Error
You might also like...
A repo to store all my 6-Month Rust learning steps

RustLearn A repo to store all my 6-Month Rust learning steps. (free time only!) at the end of the 6-month course, the repo will be a rust package for

An example of how to use Workers KV with workers-rs

rusty-kv-example An example project of how to use Workers KV with workers-rs. Usage With wrangler, you can build, test, and deploy your Worker with th

Write Cloudflare Workers in 100% Rust via WebAssembly. (A fork of workers-rs)
Write Cloudflare Workers in 100% Rust via WebAssembly. (A fork of workers-rs)

Note: This is a fork to workers-rs. Work-in-progress ergonomic Rust bindings to Cloudflare Workers environment. Write your entire worker in Rust! Read

A document-code sync tools for document engineering.

Writing A document-code sync tools for document engineering. Writing 是一个自动 “文档-代码” 同步工具。解析 Markdown 中的代码定义,读取目标代码,并嵌入到新的文档中。 Language parse support by

A tcp proxy server/client which exchange the data in temp files

ftcp A tcp proxy server/client which exchange the data in temp files 通过在临时文件中交换数据来进行TCP代理的一个服务端/客户端 学校内网中有针对教学楼的防火墙导致教室电脑难以上网( 但学校内建有公共ftp服务器,因此就有了这个借

temp - building custom deb

PL/Rust: A Trusted Procedural Language Handler for Rust PL/Rust is a loadable procedural language that enables writing PostgreSQL functions in the Rus

A cloud-native distributed serverless workers platform.

rusty-workers A cloud-native distributed serverless workers platform. Features JavaScript and WebAssembly engine powered by V8 Fetch API Highly scalab

Write Cloudflare Workers in 100% Rust via WebAssembly
Write Cloudflare Workers in 100% Rust via WebAssembly

Work-in-progress ergonomic Rust bindings to Cloudflare Workers environment. Write your entire worker in Rust! Read the Notes and FAQ Example Usage use

Telegram Bot Template with Cloudflare Workers

cf-workers-telegram-bot-template Usage This template starts you off with a src/lib.rs file, acting as an entrypoint for requests hitting your Worker.

A template for kick starting a Cloudflare worker project using workers-rs.

Getting Started A template for kick starting a Cloudflare worker project using workers-rs. This template is designed for compiling Rust to WebAssembly

Blueboat is an open-source alternative to Cloudflare Workers. The monolithic engine for serverless web apps.

Blueboat Blueboat is an open-source alternative to Cloudflare Workers. Blueboat aims to be a developer-friendly, multi-tenant platform for serverless

The system for remote workers to prevent their family members from interrupting conference calls
The system for remote workers to prevent their family members from interrupting conference calls

onair The system for remote workers to prevent their family members from interrupting conference calls. The system is designed to automatically detect

Verify Discord interactions on Cloudflare Workers with Twilight

twilight-cloudflare-workers Verify Discord interactions on Cloudflare Workers with Twilight. API The primary function in the API is process. It takes

Edgelord is a library for Cloudflare Workers. You can scaffold a basic bot for discord, slack, etc.

Edge Computing + chūnibyō = Edgelord ✨ 👿 Edgelord Edgelord is now working. You can contribute for it. Edgelord is a Rust library for cloudflare worke

A pure-Rust serverless discord chatbot hosted on Cloudflare Workers.

About A pure-Rust serverless discord chatbot hosted on Cloudflare Workers. With a free account you have up to 100k requests per day. For storing state

Log your spending in seconds with short text snippets. Powered by Rust, Cloudflare Workers and Svelte.

FastSpend Log your daily spending lightning fast with short text snippets! FastSpend is a tool to log your spending in seconds, powered by a lightning

Edge network tunnel implemented using Cloudflare Workers.

workers-tunnel Edge network tunnel implemented using Cloudflare Workers. It is recommended to use Xray as the tunnel client. https://github.com/XTLS/X

A genetic algorithm for bechmark problems, written to learn Rust.

Genetic Algorithm A genetic algorithm in Rust for the following benchmark problems: Ackley Griewangk Rastrigin Rosenbrock Schwefel Sphere Usage: Insta

Rust implementation of real-coded GA for solving optimization problems and training of neural networks
Rust implementation of real-coded GA for solving optimization problems and training of neural networks

revonet Rust implementation of real-coded genetic algorithm for solving optimization problems and training of neural networks. The latter is also know

Owner
Andrew Chin
Andrew Chin
Telegram Bot Template with Cloudflare Workers

cf-workers-telegram-bot-template Usage This template starts you off with a src/lib.rs file, acting as an entrypoint for requests hitting your Worker.

Lee Taehoon 2 Sep 23, 2021
A template for kick starting a Cloudflare worker project using workers-rs.

Getting Started A template for kick starting a Cloudflare worker project using workers-rs. This template is designed for compiling Rust to WebAssembly

Abid Omar 1 Oct 13, 2021
Blueboat is an open-source alternative to Cloudflare Workers. The monolithic engine for serverless web apps.

Blueboat Blueboat is an open-source alternative to Cloudflare Workers. Blueboat aims to be a developer-friendly, multi-tenant platform for serverless

Heyang Zhou 1.8k Jan 9, 2023
Verify Discord interactions on Cloudflare Workers with Twilight

twilight-cloudflare-workers Verify Discord interactions on Cloudflare Workers with Twilight. API The primary function in the API is process. It takes

Zeyla 5 Jun 6, 2022
Edgelord is a library for Cloudflare Workers. You can scaffold a basic bot for discord, slack, etc.

Edge Computing + chūnibyō = Edgelord ✨ ?? Edgelord Edgelord is now working. You can contribute for it. Edgelord is a Rust library for cloudflare worke

null 23 Dec 26, 2022
A pure-Rust serverless discord chatbot hosted on Cloudflare Workers.

About A pure-Rust serverless discord chatbot hosted on Cloudflare Workers. With a free account you have up to 100k requests per day. For storing state

Mike Dallas 31 Nov 21, 2022
Log your spending in seconds with short text snippets. Powered by Rust, Cloudflare Workers and Svelte.

FastSpend Log your daily spending lightning fast with short text snippets! FastSpend is a tool to log your spending in seconds, powered by a lightning

Phoomparin Mano 24 Sep 13, 2022
A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers.

ACABot A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers (or "guilds

null 4 May 3, 2022
A blazinlgy fast 🚀 transpiler written in rust 🦀 that fixes (pun intended) your problems

Pissfix ?? Pissfix is a blazingly fast ?? programming language that transpiles to a "interesting" and not well known programming language called "Post

null 3 Sep 28, 2023
Document your crate's feature flags

Document your crate's feature flags This crate provides a macro that extracts documentation comments from Cargo.toml To use this crate, add #![doc = d

SixtyFPS 83 Dec 15, 2022