You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 24, 2021. It is now read-only.
I’m using expo to build a react-native app and ran into the error "Can’t Find Variable Self" when incorporating the ooth-client. This issue https://forums.expo.io/t/cant-find-variable-self/13547 led me to realize that just importing ooth-client was causing the error but because of the isomorphic-fetch dependency.
There are pull requests out for the isomorphic-fetch package to support react-native but no updates have been made in a long while. matthew-andrews/isomorphic-fetch#80
I was looking at ooth-client source and there seems to be only one reference to importing the isomorphic-fetch package so I thought I'd give a crack at contributing.
In my own project I yard add cross-fetch and then changed the node_modules/ooth-client/lib/index.js source at line 38 from var fetch = require("isomorphic-fetch"); to var fetch = require("cross-fetch"); and I no longer get the "Can’t Find Variable Self" error.
I forked the ooth repo and added cross-fetch to package.json and made the change in the ooth-client source but I dont feel comfortable submitting a PR without passing tests. So I've yarn installed in the packages/ooth-client folder and done a yarn test and it fails with this error and now I'm a little lost and any help is appreciated.
src/index.ts:157:13 - error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("cross-fetch")' has no compatible call signatures.
The text was updated successfully, but these errors were encountered:
I’m using expo to build a react-native app and ran into the error "Can’t Find Variable Self" when incorporating the ooth-client. This issue https://forums.expo.io/t/cant-find-variable-self/13547 led me to realize that just importing ooth-client was causing the error but because of the isomorphic-fetch dependency.
There are pull requests out for the isomorphic-fetch package to support react-native but no updates have been made in a long while. matthew-andrews/isomorphic-fetch#80
I was looking at ooth-client source and there seems to be only one reference to importing the isomorphic-fetch package so I thought I'd give a crack at contributing.
In my own project I
yard add cross-fetch
and then changed the node_modules/ooth-client/lib/index.js source at line 38 fromvar fetch = require("isomorphic-fetch");
tovar fetch = require("cross-fetch");
and I no longer get the "Can’t Find Variable Self" error.I forked the ooth repo and added cross-fetch to package.json and made the change in the ooth-client source but I dont feel comfortable submitting a PR without passing tests. So I've yarn installed in the packages/ooth-client folder and done a
yarn test
and it fails with this error and now I'm a little lost and any help is appreciated.The text was updated successfully, but these errors were encountered: