I am attempting to use iosmorphic-fetch on node 6.10 with typescript but am running into some issues. I am trying to remove the dom lib/polyfill from my tsconfig:
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"lib": [
"esnext",
"dom" // <-- would like to remove this
],
When I try to do this, I get the following error during my tsc (typescript compiler):
node_modules/@types/isomorphic-fetch/index.d.ts(8,30): error TS2552: Cannot find name 'fetch'. Did you mean '_fetch'?
Not sure if I have botched the setup somehow or whether this is a bug.
Would assume this is because a global fetch method is only available in a browser environment, not in node.js. So you probably have to declare it manually, like so declare const fetch: any;
Good Evening,
I am attempting to use iosmorphic-fetch on node 6.10 with typescript but am running into some issues. I am trying to remove the
dom
lib/polyfill from mytsconfig
:When I try to do this, I get the following error during my tsc (typescript compiler):
Not sure if I have botched the setup somehow or whether this is a bug.
Package.json:
Thanks!