Hi everyone, I'm trying to test the following code using Miniflare. However, I'm encountering the fo

Hi everyone, I'm trying to test the following code using Miniflare. However, I'm encountering the following error when I run the test:
root@2be3ebaf0051:/app/server# node tests/test.js
success
status: OK
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 I/O context have already finished.
Error: The script will never generate a response.
at async Object.fetch (file:///app/server/node_modules/miniflare/dist/src/workers/core/entry.worker.js:1029:22)
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

assert(res.ok)

at main (file:///app/server/tests/test.js:31:5)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='
}
root@2be3ebaf0051:/app/server# node tests/test.js
success
status: OK
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 I/O context have already finished.
Error: The script will never generate a response.
at async Object.fetch (file:///app/server/node_modules/miniflare/dist/src/workers/core/entry.worker.js:1029:22)
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

assert(res.ok)

at main (file:///app/server/tests/test.js:31:5)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='
}
The success and status:OK logs are ones I added, indicating that the request is being received and processed correctly. When I send requests using REST Client, everything works as expected.Could anyone help me figure out what's wrong?
11 Replies
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
radix
radix2mo ago
I've been looking forward to sqlite in DOs for quite a while, glad to see it's finally here! Is anyone working on adding support to it in workers-rs?
MissionaryGamer
MissionaryGamer2mo ago
Has anyone managed to get the integrated Build process to work with a RUST workers-rs project? I had it working successfully from the Github to Cloudflare side - but failing on porting this to the Cloudflare side. Even after installing cargo from the Build steps:
curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="$HOME/.cargo/bin:$PATH" && rustup target add wasm32-unknown-unknown && cargo install -q worker-build && worker-build --release
curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="$HOME/.cargo/bin:$PATH" && rustup target add wasm32-unknown-unknown && cargo install -q worker-build && worker-build --release
I'm getting this error in the on the deploy step.
13:37:30.186 Rust is installed now. Great!
... Compiling log entries truncated by me full log attached.
13:42:40.542 Success: Build command completed
13:42:40.543 Executing user deploy command: npx wrangler deploy
13:42:44.163 npm warn exec The following package was not found and will be installed: [email protected]
13:43:18.552 npm warn deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
13:43:18.581 npm warn deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
13:43:22.181
13:43:22.181 ⛅️ wrangler 3.78.10
13:43:22.181 --------------------
13:43:22.181
13:43:22.188 Running custom build: cargo install -q worker-build && worker-build --release
13:43:22.193 /bin/sh: 1: cargo: not found
13:43:22.196
13:43:22.262 ✘ [ERROR] Running custom build `cargo install -q worker-build && worker-build --release` failed. There are likely more logs from your build command above.
13:37:30.186 Rust is installed now. Great!
... Compiling log entries truncated by me full log attached.
13:42:40.542 Success: Build command completed
13:42:40.543 Executing user deploy command: npx wrangler deploy
13:42:44.163 npm warn exec The following package was not found and will be installed: [email protected]
13:43:18.552 npm warn deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
13:43:18.581 npm warn deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
13:43:22.181
13:43:22.181 ⛅️ wrangler 3.78.10
13:43:22.181 --------------------
13:43:22.181
13:43:22.188 Running custom build: cargo install -q worker-build && worker-build --release
13:43:22.193 /bin/sh: 1: cargo: not found
13:43:22.196
13:43:22.262 ✘ [ERROR] Running custom build `cargo install -q worker-build && worker-build --release` failed. There are likely more logs from your build command above.
MissionaryGamer
MissionaryGamer2mo ago
Fixed it by adding the path to the Deploy Command: export PATH="$HOME/.cargo/bin:$PATH" && npx wrangler deploy Seems this shouldn't be necessary but it works now.
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
ryanmoziyi
ryanmoziyi2mo ago
Hii everyone
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
ryanmoziyi
ryanmoziyi2mo ago
No description
No description
ryanmoziyi
ryanmoziyi2mo ago
yes My xml maps are fine, but my google sitemap prompts can't be crawled, sometimes again. How can I solve this problem I think it might be the server
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
ryanmoziyi
ryanmoziyi2mo ago
How do I submit manually and my sitemap is normally It is working Its shows my service is no problem My other sites don't have this problem, all my sites are on the same server Could it be a problem with the multilingual plugin gtranslate Have u
Want results from more Discord servers?
Add your server