Bug Description
We are using abort-controller from npm in our codebase with undici. undici fails with:
TypeError: AbortSignal: Expected [object AbortSignal] to be an instance of AbortSignal.
Reproducible By
https://replit.com/@SukkaW/ImaginaryDishonestCommunication#index.js
const { AbortController } = require('abort-controller');
const { fetch } = require('undici');
const controller = new AbortController()
controller.abort()
try {
fetch('https://example.com', {
signal: controller.signal,
})
} catch (error) {
console.log(error.message)
}
Expected Behavior
The error AbortError: The operation is aborted should be shown instead.
Environment
Node.js 18.7.0 on macOS 13 Beta 4
Additional Context
I have searched the codebase of undici and I notice this:
|
webidl.converters.AbortSignal = webidl.interfaceConverter( |
|
AbortSignal |
|
) |
Bug Description
We are using
abort-controllerfrom npm in our codebase with undici. undici fails with:Reproducible By
https://replit.com/@SukkaW/ImaginaryDishonestCommunication#index.js
Expected Behavior
The error
AbortError: The operation is abortedshould be shown instead.Environment
Node.js 18.7.0 on macOS 13 Beta 4
Additional Context
I have searched the codebase of undici and I notice this:
undici/lib/fetch/request.js
Lines 838 to 840 in 5890e16