fix: add error message on node.js if undici isn't supported

pull/53/head
Travis Fischer 2022-12-07 21:28:26 -06:00
rodzic 35a298470d
commit 624823e6db
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -16,6 +16,12 @@ const fetch =
_undici = await import('undici')
}
if (typeof _undici?.fetch !== 'function') {
throw new Error(
'Invalid undici installation; please make sure undici is installed correctly in your node_modules. Note that this package requires Node.js >= 16.8'
)
}
return _undici.fetch(...args)
}