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?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?