In Expo, Requiring module “fetch”, threw an exception: ReferenceError: Can't find variable: self












2















I have searched across different possible answers, but didn't find any appropriate addressing this specific error.



I have mentioned the exact error string in the question title. This error started appearing when I installed fetch npm module in my ReactNative app. This error appears just at the time app is launched/loaded on my phone during development. Before installing fetch, my app was loading correctly on the phone. In windows CLI there is no such error that assist me to resolve the issue, it just shows the build is successful.



I am using Expo for my ReactNative app development. Please assist in this regard to resolve the issue. Further details can be seen in following attached screen (that shows stack trace):



Expo error on app load



Package.json



{
"name": "my-new-project",
"main": "node_modules/expo/AppEntry.js",
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/samples": "2.1.1",
"expo": "29.0.0",
"fetch": "^1.1.0",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
"react-navigation": "^2.9.3"
},
"devDependencies": {
"jest-expo": "29.0.0"
}
}


This is a quite strange issue, that when I Uninstall fetch and try to use any other library e.g. axios, the reference to same error (related to fetch module) still appears. I have restarted my laptop machine, and restarted Expo app on mobile as well.










share|improve this question





























    2















    I have searched across different possible answers, but didn't find any appropriate addressing this specific error.



    I have mentioned the exact error string in the question title. This error started appearing when I installed fetch npm module in my ReactNative app. This error appears just at the time app is launched/loaded on my phone during development. Before installing fetch, my app was loading correctly on the phone. In windows CLI there is no such error that assist me to resolve the issue, it just shows the build is successful.



    I am using Expo for my ReactNative app development. Please assist in this regard to resolve the issue. Further details can be seen in following attached screen (that shows stack trace):



    Expo error on app load



    Package.json



    {
    "name": "my-new-project",
    "main": "node_modules/expo/AppEntry.js",
    "private": true,
    "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject",
    "test": "node ./node_modules/jest/bin/jest.js --watchAll"
    },
    "jest": {
    "preset": "jest-expo"
    },
    "dependencies": {
    "@expo/samples": "2.1.1",
    "expo": "29.0.0",
    "fetch": "^1.1.0",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
    "react-navigation": "^2.9.3"
    },
    "devDependencies": {
    "jest-expo": "29.0.0"
    }
    }


    This is a quite strange issue, that when I Uninstall fetch and try to use any other library e.g. axios, the reference to same error (related to fetch module) still appears. I have restarted my laptop machine, and restarted Expo app on mobile as well.










    share|improve this question



























      2












      2








      2


      1






      I have searched across different possible answers, but didn't find any appropriate addressing this specific error.



      I have mentioned the exact error string in the question title. This error started appearing when I installed fetch npm module in my ReactNative app. This error appears just at the time app is launched/loaded on my phone during development. Before installing fetch, my app was loading correctly on the phone. In windows CLI there is no such error that assist me to resolve the issue, it just shows the build is successful.



      I am using Expo for my ReactNative app development. Please assist in this regard to resolve the issue. Further details can be seen in following attached screen (that shows stack trace):



      Expo error on app load



      Package.json



      {
      "name": "my-new-project",
      "main": "node_modules/expo/AppEntry.js",
      "private": true,
      "scripts": {
      "start": "expo start",
      "android": "expo start --android",
      "ios": "expo start --ios",
      "eject": "expo eject",
      "test": "node ./node_modules/jest/bin/jest.js --watchAll"
      },
      "jest": {
      "preset": "jest-expo"
      },
      "dependencies": {
      "@expo/samples": "2.1.1",
      "expo": "29.0.0",
      "fetch": "^1.1.0",
      "react": "16.3.1",
      "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
      "react-navigation": "^2.9.3"
      },
      "devDependencies": {
      "jest-expo": "29.0.0"
      }
      }


      This is a quite strange issue, that when I Uninstall fetch and try to use any other library e.g. axios, the reference to same error (related to fetch module) still appears. I have restarted my laptop machine, and restarted Expo app on mobile as well.










      share|improve this question
















      I have searched across different possible answers, but didn't find any appropriate addressing this specific error.



      I have mentioned the exact error string in the question title. This error started appearing when I installed fetch npm module in my ReactNative app. This error appears just at the time app is launched/loaded on my phone during development. Before installing fetch, my app was loading correctly on the phone. In windows CLI there is no such error that assist me to resolve the issue, it just shows the build is successful.



      I am using Expo for my ReactNative app development. Please assist in this regard to resolve the issue. Further details can be seen in following attached screen (that shows stack trace):



      Expo error on app load



      Package.json



      {
      "name": "my-new-project",
      "main": "node_modules/expo/AppEntry.js",
      "private": true,
      "scripts": {
      "start": "expo start",
      "android": "expo start --android",
      "ios": "expo start --ios",
      "eject": "expo eject",
      "test": "node ./node_modules/jest/bin/jest.js --watchAll"
      },
      "jest": {
      "preset": "jest-expo"
      },
      "dependencies": {
      "@expo/samples": "2.1.1",
      "expo": "29.0.0",
      "fetch": "^1.1.0",
      "react": "16.3.1",
      "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
      "react-navigation": "^2.9.3"
      },
      "devDependencies": {
      "jest-expo": "29.0.0"
      }
      }


      This is a quite strange issue, that when I Uninstall fetch and try to use any other library e.g. axios, the reference to same error (related to fetch module) still appears. I have restarted my laptop machine, and restarted Expo app on mobile as well.







      react-native fetch expo npm-scripts






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 27 '18 at 9:26







      Muhammad Hannan

















      asked Sep 27 '18 at 8:50









      Muhammad HannanMuhammad Hannan

      627727




      627727
























          4 Answers
          4






          active

          oldest

          votes


















          1














          On my side, the error was triggered each time I shut down and restart the pc (I develop on Ubuntu 16.04 ).



          I used an old answer ( 2016 ) which completely fixed the issue:



          I added:



          global.self = global;


          into the main js file.



          And everything is back to normal.



          expo-cli is at 2.2.4 ( last version )






          share|improve this answer


























          • You didn't added the reference to the detailed answer which helped you fix the problem. Also, it is better if you past the new main .js file syntax showing where exactly you added this.

            – Muhammad Hannan
            Oct 31 '18 at 7:35













          • The above worked well for me. I added the line into my App.js after imports and everything was golden

            – Ernest
            Dec 1 '18 at 7:23





















          0














          I think fetch 1.1.0 cannot work well on React Native because React Native use JS core not NodeJS.
          I prefer you use library axios or built-in 'fetch' of React Native (https://facebook.github.io/react-native/docs/network.html).



          npm install axios --save



          Example



          // Want to use async/await? Add the `async` keyword to your outer function/method.
          async function getUser() {
          try {
          const response = await axios.get('/user?ID=12345');
          console.log(response);
          } catch (error) {
          console.error(error);
          }
          }


          or



          const axios = require('axios');

          // Make a request for a user with a given ID
          axios.get('/user?ID=12345')
          .then(function (response) {
          // handle success
          console.log(response);
          })
          .catch(function (error) {
          // handle error
          console.log(error);
          })
          .then(function () {
          // always executed
          });

          // Optionally the request above could also be done as
          axios.get('/user', {
          params: {
          ID: 12345
          }
          })
          .then(function (response) {
          console.log(response);
          })
          .catch(function (error) {
          console.log(error);
          })
          .then(function () {
          // always executed
          });





          share|improve this answer
























          • This is quite strange that I have uninstalled fetch and also reinstalled expo-cli (globally) but the reference to self error is still there. It seems like I have to recreate whole project from scratch. I also run npm cache clean --force but no success. Any suggestion?

            – Muhammad Hannan
            Sep 27 '18 at 10:03











          • I think you still need delete node_modules and install again with rm -rf node_modules and npm install. And need restart dev server again. I prefer start dev server with command npm start --reset-cache or yarn start --reset-cache

            – Tung Duong
            Sep 27 '18 at 10:06













          • I have removed node_modules/ directory. Restarted machine, then run npm install but no success. Same issue I originally posted. However you mentioned npm start, this does not work correctly from last few days on my machine, and for that I have posted a separate question here: stackoverflow.com/questions/52534354/…

            – Muhammad Hannan
            Sep 27 '18 at 10:22



















          0














          I have figured it out, basically it was not the npm neither the NPM fetch component issue. Basically after setting up the project I ran npm install expo-cli which message was appearing in CLI when I try to run expo start or npm start. At this time there was new version available v30.x.x, and YES the self reference issue was in older expo version but not in v30.x.x.



          After installing expo-cli it was not matching to my existing project expo configuration and installed files, hence I re-setup the project again, which loaded and installed latest version libraries and coppied the project files into it.



          And boom! The application ran without any error this time.






          share|improve this answer
























          • For me upgrading to expo-cli@2.2.0 produced this error. Downgrading to expo-cli@2.1.3 got it working again.

            – Paul Parker
            Oct 9 '18 at 14:08



















          0














          It looks like the issue is produced by the fresh version of whatwg-fetch. The solutions, which works for me is explicit adding the older version:




          npm i whatwg-fetch@2.0.4

          or

          yarn add whatwg-fetch@2.0.4



          Solution taken from here






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52533013%2fin-expo-requiring-module-fetch-threw-an-exception-referenceerror-cant-fin%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            On my side, the error was triggered each time I shut down and restart the pc (I develop on Ubuntu 16.04 ).



            I used an old answer ( 2016 ) which completely fixed the issue:



            I added:



            global.self = global;


            into the main js file.



            And everything is back to normal.



            expo-cli is at 2.2.4 ( last version )






            share|improve this answer


























            • You didn't added the reference to the detailed answer which helped you fix the problem. Also, it is better if you past the new main .js file syntax showing where exactly you added this.

              – Muhammad Hannan
              Oct 31 '18 at 7:35













            • The above worked well for me. I added the line into my App.js after imports and everything was golden

              – Ernest
              Dec 1 '18 at 7:23


















            1














            On my side, the error was triggered each time I shut down and restart the pc (I develop on Ubuntu 16.04 ).



            I used an old answer ( 2016 ) which completely fixed the issue:



            I added:



            global.self = global;


            into the main js file.



            And everything is back to normal.



            expo-cli is at 2.2.4 ( last version )






            share|improve this answer


























            • You didn't added the reference to the detailed answer which helped you fix the problem. Also, it is better if you past the new main .js file syntax showing where exactly you added this.

              – Muhammad Hannan
              Oct 31 '18 at 7:35













            • The above worked well for me. I added the line into my App.js after imports and everything was golden

              – Ernest
              Dec 1 '18 at 7:23
















            1












            1








            1







            On my side, the error was triggered each time I shut down and restart the pc (I develop on Ubuntu 16.04 ).



            I used an old answer ( 2016 ) which completely fixed the issue:



            I added:



            global.self = global;


            into the main js file.



            And everything is back to normal.



            expo-cli is at 2.2.4 ( last version )






            share|improve this answer















            On my side, the error was triggered each time I shut down and restart the pc (I develop on Ubuntu 16.04 ).



            I used an old answer ( 2016 ) which completely fixed the issue:



            I added:



            global.self = global;


            into the main js file.



            And everything is back to normal.



            expo-cli is at 2.2.4 ( last version )







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 30 '18 at 13:12









            Ale

            68731421




            68731421










            answered Oct 30 '18 at 11:05









            Hyphæne OhmenHyphæne Ohmen

            515




            515













            • You didn't added the reference to the detailed answer which helped you fix the problem. Also, it is better if you past the new main .js file syntax showing where exactly you added this.

              – Muhammad Hannan
              Oct 31 '18 at 7:35













            • The above worked well for me. I added the line into my App.js after imports and everything was golden

              – Ernest
              Dec 1 '18 at 7:23





















            • You didn't added the reference to the detailed answer which helped you fix the problem. Also, it is better if you past the new main .js file syntax showing where exactly you added this.

              – Muhammad Hannan
              Oct 31 '18 at 7:35













            • The above worked well for me. I added the line into my App.js after imports and everything was golden

              – Ernest
              Dec 1 '18 at 7:23



















            You didn't added the reference to the detailed answer which helped you fix the problem. Also, it is better if you past the new main .js file syntax showing where exactly you added this.

            – Muhammad Hannan
            Oct 31 '18 at 7:35







            You didn't added the reference to the detailed answer which helped you fix the problem. Also, it is better if you past the new main .js file syntax showing where exactly you added this.

            – Muhammad Hannan
            Oct 31 '18 at 7:35















            The above worked well for me. I added the line into my App.js after imports and everything was golden

            – Ernest
            Dec 1 '18 at 7:23







            The above worked well for me. I added the line into my App.js after imports and everything was golden

            – Ernest
            Dec 1 '18 at 7:23















            0














            I think fetch 1.1.0 cannot work well on React Native because React Native use JS core not NodeJS.
            I prefer you use library axios or built-in 'fetch' of React Native (https://facebook.github.io/react-native/docs/network.html).



            npm install axios --save



            Example



            // Want to use async/await? Add the `async` keyword to your outer function/method.
            async function getUser() {
            try {
            const response = await axios.get('/user?ID=12345');
            console.log(response);
            } catch (error) {
            console.error(error);
            }
            }


            or



            const axios = require('axios');

            // Make a request for a user with a given ID
            axios.get('/user?ID=12345')
            .then(function (response) {
            // handle success
            console.log(response);
            })
            .catch(function (error) {
            // handle error
            console.log(error);
            })
            .then(function () {
            // always executed
            });

            // Optionally the request above could also be done as
            axios.get('/user', {
            params: {
            ID: 12345
            }
            })
            .then(function (response) {
            console.log(response);
            })
            .catch(function (error) {
            console.log(error);
            })
            .then(function () {
            // always executed
            });





            share|improve this answer
























            • This is quite strange that I have uninstalled fetch and also reinstalled expo-cli (globally) but the reference to self error is still there. It seems like I have to recreate whole project from scratch. I also run npm cache clean --force but no success. Any suggestion?

              – Muhammad Hannan
              Sep 27 '18 at 10:03











            • I think you still need delete node_modules and install again with rm -rf node_modules and npm install. And need restart dev server again. I prefer start dev server with command npm start --reset-cache or yarn start --reset-cache

              – Tung Duong
              Sep 27 '18 at 10:06













            • I have removed node_modules/ directory. Restarted machine, then run npm install but no success. Same issue I originally posted. However you mentioned npm start, this does not work correctly from last few days on my machine, and for that I have posted a separate question here: stackoverflow.com/questions/52534354/…

              – Muhammad Hannan
              Sep 27 '18 at 10:22
















            0














            I think fetch 1.1.0 cannot work well on React Native because React Native use JS core not NodeJS.
            I prefer you use library axios or built-in 'fetch' of React Native (https://facebook.github.io/react-native/docs/network.html).



            npm install axios --save



            Example



            // Want to use async/await? Add the `async` keyword to your outer function/method.
            async function getUser() {
            try {
            const response = await axios.get('/user?ID=12345');
            console.log(response);
            } catch (error) {
            console.error(error);
            }
            }


            or



            const axios = require('axios');

            // Make a request for a user with a given ID
            axios.get('/user?ID=12345')
            .then(function (response) {
            // handle success
            console.log(response);
            })
            .catch(function (error) {
            // handle error
            console.log(error);
            })
            .then(function () {
            // always executed
            });

            // Optionally the request above could also be done as
            axios.get('/user', {
            params: {
            ID: 12345
            }
            })
            .then(function (response) {
            console.log(response);
            })
            .catch(function (error) {
            console.log(error);
            })
            .then(function () {
            // always executed
            });





            share|improve this answer
























            • This is quite strange that I have uninstalled fetch and also reinstalled expo-cli (globally) but the reference to self error is still there. It seems like I have to recreate whole project from scratch. I also run npm cache clean --force but no success. Any suggestion?

              – Muhammad Hannan
              Sep 27 '18 at 10:03











            • I think you still need delete node_modules and install again with rm -rf node_modules and npm install. And need restart dev server again. I prefer start dev server with command npm start --reset-cache or yarn start --reset-cache

              – Tung Duong
              Sep 27 '18 at 10:06













            • I have removed node_modules/ directory. Restarted machine, then run npm install but no success. Same issue I originally posted. However you mentioned npm start, this does not work correctly from last few days on my machine, and for that I have posted a separate question here: stackoverflow.com/questions/52534354/…

              – Muhammad Hannan
              Sep 27 '18 at 10:22














            0












            0








            0







            I think fetch 1.1.0 cannot work well on React Native because React Native use JS core not NodeJS.
            I prefer you use library axios or built-in 'fetch' of React Native (https://facebook.github.io/react-native/docs/network.html).



            npm install axios --save



            Example



            // Want to use async/await? Add the `async` keyword to your outer function/method.
            async function getUser() {
            try {
            const response = await axios.get('/user?ID=12345');
            console.log(response);
            } catch (error) {
            console.error(error);
            }
            }


            or



            const axios = require('axios');

            // Make a request for a user with a given ID
            axios.get('/user?ID=12345')
            .then(function (response) {
            // handle success
            console.log(response);
            })
            .catch(function (error) {
            // handle error
            console.log(error);
            })
            .then(function () {
            // always executed
            });

            // Optionally the request above could also be done as
            axios.get('/user', {
            params: {
            ID: 12345
            }
            })
            .then(function (response) {
            console.log(response);
            })
            .catch(function (error) {
            console.log(error);
            })
            .then(function () {
            // always executed
            });





            share|improve this answer













            I think fetch 1.1.0 cannot work well on React Native because React Native use JS core not NodeJS.
            I prefer you use library axios or built-in 'fetch' of React Native (https://facebook.github.io/react-native/docs/network.html).



            npm install axios --save



            Example



            // Want to use async/await? Add the `async` keyword to your outer function/method.
            async function getUser() {
            try {
            const response = await axios.get('/user?ID=12345');
            console.log(response);
            } catch (error) {
            console.error(error);
            }
            }


            or



            const axios = require('axios');

            // Make a request for a user with a given ID
            axios.get('/user?ID=12345')
            .then(function (response) {
            // handle success
            console.log(response);
            })
            .catch(function (error) {
            // handle error
            console.log(error);
            })
            .then(function () {
            // always executed
            });

            // Optionally the request above could also be done as
            axios.get('/user', {
            params: {
            ID: 12345
            }
            })
            .then(function (response) {
            console.log(response);
            })
            .catch(function (error) {
            console.log(error);
            })
            .then(function () {
            // always executed
            });






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 27 '18 at 9:28









            Tung DuongTung Duong

            745216




            745216













            • This is quite strange that I have uninstalled fetch and also reinstalled expo-cli (globally) but the reference to self error is still there. It seems like I have to recreate whole project from scratch. I also run npm cache clean --force but no success. Any suggestion?

              – Muhammad Hannan
              Sep 27 '18 at 10:03











            • I think you still need delete node_modules and install again with rm -rf node_modules and npm install. And need restart dev server again. I prefer start dev server with command npm start --reset-cache or yarn start --reset-cache

              – Tung Duong
              Sep 27 '18 at 10:06













            • I have removed node_modules/ directory. Restarted machine, then run npm install but no success. Same issue I originally posted. However you mentioned npm start, this does not work correctly from last few days on my machine, and for that I have posted a separate question here: stackoverflow.com/questions/52534354/…

              – Muhammad Hannan
              Sep 27 '18 at 10:22



















            • This is quite strange that I have uninstalled fetch and also reinstalled expo-cli (globally) but the reference to self error is still there. It seems like I have to recreate whole project from scratch. I also run npm cache clean --force but no success. Any suggestion?

              – Muhammad Hannan
              Sep 27 '18 at 10:03











            • I think you still need delete node_modules and install again with rm -rf node_modules and npm install. And need restart dev server again. I prefer start dev server with command npm start --reset-cache or yarn start --reset-cache

              – Tung Duong
              Sep 27 '18 at 10:06













            • I have removed node_modules/ directory. Restarted machine, then run npm install but no success. Same issue I originally posted. However you mentioned npm start, this does not work correctly from last few days on my machine, and for that I have posted a separate question here: stackoverflow.com/questions/52534354/…

              – Muhammad Hannan
              Sep 27 '18 at 10:22

















            This is quite strange that I have uninstalled fetch and also reinstalled expo-cli (globally) but the reference to self error is still there. It seems like I have to recreate whole project from scratch. I also run npm cache clean --force but no success. Any suggestion?

            – Muhammad Hannan
            Sep 27 '18 at 10:03





            This is quite strange that I have uninstalled fetch and also reinstalled expo-cli (globally) but the reference to self error is still there. It seems like I have to recreate whole project from scratch. I also run npm cache clean --force but no success. Any suggestion?

            – Muhammad Hannan
            Sep 27 '18 at 10:03













            I think you still need delete node_modules and install again with rm -rf node_modules and npm install. And need restart dev server again. I prefer start dev server with command npm start --reset-cache or yarn start --reset-cache

            – Tung Duong
            Sep 27 '18 at 10:06







            I think you still need delete node_modules and install again with rm -rf node_modules and npm install. And need restart dev server again. I prefer start dev server with command npm start --reset-cache or yarn start --reset-cache

            – Tung Duong
            Sep 27 '18 at 10:06















            I have removed node_modules/ directory. Restarted machine, then run npm install but no success. Same issue I originally posted. However you mentioned npm start, this does not work correctly from last few days on my machine, and for that I have posted a separate question here: stackoverflow.com/questions/52534354/…

            – Muhammad Hannan
            Sep 27 '18 at 10:22





            I have removed node_modules/ directory. Restarted machine, then run npm install but no success. Same issue I originally posted. However you mentioned npm start, this does not work correctly from last few days on my machine, and for that I have posted a separate question here: stackoverflow.com/questions/52534354/…

            – Muhammad Hannan
            Sep 27 '18 at 10:22











            0














            I have figured it out, basically it was not the npm neither the NPM fetch component issue. Basically after setting up the project I ran npm install expo-cli which message was appearing in CLI when I try to run expo start or npm start. At this time there was new version available v30.x.x, and YES the self reference issue was in older expo version but not in v30.x.x.



            After installing expo-cli it was not matching to my existing project expo configuration and installed files, hence I re-setup the project again, which loaded and installed latest version libraries and coppied the project files into it.



            And boom! The application ran without any error this time.






            share|improve this answer
























            • For me upgrading to expo-cli@2.2.0 produced this error. Downgrading to expo-cli@2.1.3 got it working again.

              – Paul Parker
              Oct 9 '18 at 14:08
















            0














            I have figured it out, basically it was not the npm neither the NPM fetch component issue. Basically after setting up the project I ran npm install expo-cli which message was appearing in CLI when I try to run expo start or npm start. At this time there was new version available v30.x.x, and YES the self reference issue was in older expo version but not in v30.x.x.



            After installing expo-cli it was not matching to my existing project expo configuration and installed files, hence I re-setup the project again, which loaded and installed latest version libraries and coppied the project files into it.



            And boom! The application ran without any error this time.






            share|improve this answer
























            • For me upgrading to expo-cli@2.2.0 produced this error. Downgrading to expo-cli@2.1.3 got it working again.

              – Paul Parker
              Oct 9 '18 at 14:08














            0












            0








            0







            I have figured it out, basically it was not the npm neither the NPM fetch component issue. Basically after setting up the project I ran npm install expo-cli which message was appearing in CLI when I try to run expo start or npm start. At this time there was new version available v30.x.x, and YES the self reference issue was in older expo version but not in v30.x.x.



            After installing expo-cli it was not matching to my existing project expo configuration and installed files, hence I re-setup the project again, which loaded and installed latest version libraries and coppied the project files into it.



            And boom! The application ran without any error this time.






            share|improve this answer













            I have figured it out, basically it was not the npm neither the NPM fetch component issue. Basically after setting up the project I ran npm install expo-cli which message was appearing in CLI when I try to run expo start or npm start. At this time there was new version available v30.x.x, and YES the self reference issue was in older expo version but not in v30.x.x.



            After installing expo-cli it was not matching to my existing project expo configuration and installed files, hence I re-setup the project again, which loaded and installed latest version libraries and coppied the project files into it.



            And boom! The application ran without any error this time.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 30 '18 at 2:05









            Muhammad HannanMuhammad Hannan

            627727




            627727













            • For me upgrading to expo-cli@2.2.0 produced this error. Downgrading to expo-cli@2.1.3 got it working again.

              – Paul Parker
              Oct 9 '18 at 14:08



















            • For me upgrading to expo-cli@2.2.0 produced this error. Downgrading to expo-cli@2.1.3 got it working again.

              – Paul Parker
              Oct 9 '18 at 14:08

















            For me upgrading to expo-cli@2.2.0 produced this error. Downgrading to expo-cli@2.1.3 got it working again.

            – Paul Parker
            Oct 9 '18 at 14:08





            For me upgrading to expo-cli@2.2.0 produced this error. Downgrading to expo-cli@2.1.3 got it working again.

            – Paul Parker
            Oct 9 '18 at 14:08











            0














            It looks like the issue is produced by the fresh version of whatwg-fetch. The solutions, which works for me is explicit adding the older version:




            npm i whatwg-fetch@2.0.4

            or

            yarn add whatwg-fetch@2.0.4



            Solution taken from here






            share|improve this answer




























              0














              It looks like the issue is produced by the fresh version of whatwg-fetch. The solutions, which works for me is explicit adding the older version:




              npm i whatwg-fetch@2.0.4

              or

              yarn add whatwg-fetch@2.0.4



              Solution taken from here






              share|improve this answer


























                0












                0








                0







                It looks like the issue is produced by the fresh version of whatwg-fetch. The solutions, which works for me is explicit adding the older version:




                npm i whatwg-fetch@2.0.4

                or

                yarn add whatwg-fetch@2.0.4



                Solution taken from here






                share|improve this answer













                It looks like the issue is produced by the fresh version of whatwg-fetch. The solutions, which works for me is explicit adding the older version:




                npm i whatwg-fetch@2.0.4

                or

                yarn add whatwg-fetch@2.0.4



                Solution taken from here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 28 '18 at 23:15









                Alexandr PriezzhevAlexandr Priezzhev

                11210




                11210






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52533013%2fin-expo-requiring-module-fetch-threw-an-exception-referenceerror-cant-fin%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Mossoró

                    Error while reading .h5 file using the rhdf5 package in R

                    Pushsharp Apns notification error: 'InvalidToken'