4

We are creating an application on Microsoft Bot Framework for Microsoft Teams. This app uses isomorphic fetch to make graph API calls for handling user call-related API. After importing the isomorphic fetch in the app in the required file callApi.ts for the calling modules of graph API. The app gets built without any errors for local debugging. We can run it locally but when we deploy the app to Azure cloud after deploying based on checking the locks regard to knowing that the isomorphic fetch package is not found which is a dependency in call API due to which the bot is not working.

Error Log of Bot from Azure

Basic info about Isomorphic fetch for reference:
Isomorphic fetch is a library that provides a consistent API for making HTTP requests, compatible with browser and Node.js environments. It allows writing code that can run on both the client and server sides without any modifications.

Why / How we are using it?
It is not being used as a choice but as a dependency package graph API requirement. enter image description here

The first query will be about trying to import it into both dev and build dependencies, here is my package.json. enter image description here

Based on the code implementation, we are not using fetch.get(...) or node-fetch.get(...) or isomorphic-fetch.get(...) This module is just imported and placed there, it is not being called in any of the functions.

Approaches already tried:

  1. Removing the isomorphic-fetch and try build enter image description here
  2. Tried using fetch or node-fetch instead of isomorphic fetch enter image description here
  3. Reinstalling the module with and without removing node module folder.

Is there any solution to this kind of scenario or any possibility of missing any specific step resulting in this situation? Please feel free to comment back if any further information is required.

IAM5K
  • 257
  • 3
  • 10

2 Answers2

3

Remove isomorphic-fetch from the dev dependency and keep it only in the main dependencies.

If you see that the production build doesn't include a package that is listed in both "dependencies" and "devDependencies", it means that the build process is correctly excluding the development dependencies, as expected.

Vikas Kyatannawar
  • 136
  • 1
  • 1
  • 8
0

Try these below suggestions if not tried: -Reinstall the library. -Clear the bot's cache. -Redeploy the bot.

Additional point:Adding these point for testing but not sure it might leads to incompatibility, -Using a different version of the isomorphic-fetch library.

  • Thanks for your response, There is no cache clearing, I have reinstalled the module but it didn't work. Checked with other versions as well. latest version is 3.0.0 updated in 2020. – IAM5K Jul 21 '23 at 06:54