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.
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.
The first query will be about trying to import it into both dev and build dependencies, here is my package.json.
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:
isomorphic-fetch
and try build
fetch
or node-fetch
instead of isomorphic fetch
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.
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.