microsoft/BotFramework-DirectLineJS

Unable to resolve module `stream` from `node_modules\botframework-streaming\browser\subscribableStream.js`

harshchawda opened this issue · 11 comments

I am trying to integrate Botframework-DirectlineJS to my react-native app but after installing the package "botframework-directlinejs" I am getting the following error inside dependency of a node module.

error: Error: Unable to resolve module stream from node_modules\botframework-streaming\browser\subscribableStream.js: stream could not be found within the project.

If you are sure the module exists, try these steps:

  1. Clear watchman watches: watchman watch-del-all
  2. Delete node_modules: rm -rf node_modules and run yarn install
  3. Reset Metro's cache: yarn start --reset-cache
  4. Remove the cache: rm -rf /tmp/metro-*
    at ModuleResolver.resolveDependency (C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:186:15)
    at ResolutionRequest.resolveDependency (C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\node-haste\DependencyGraph.js:287:16)
    at Object.resolve (C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\lib\transformHelpers.js:267:42)
    at C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\DeltaBundler\traverseDependencies.js:434:31
    at Array.map ()
    at resolveDependencies (C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\DeltaBundler\traverseDependencies.js:431:18)
    at C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\DeltaBundler\traverseDependencies.js:275:33
    at Generator.next ()
    at asyncGeneratorStep (C:\Users\Harsh.Chawda\Documents\POC\HealthAndSafetyPOC\Health-and-Safety-Frontend\node_modules\metro\src\DeltaBundler\traverseDependencies.js:87:24)

This should land in the 4.11 release and is reliant on microsoft/botbuilder-js#2942.

@stevengum can you confirm this shipping with JS R11?

I am at this same issue.

What is the work around? Not sure why it is in the package if its not yet available - or am I miss understanding which package is being used?

Many thanks,

@drfbwilliams I have degraded the the "botframework-directlinejs" package to 0.11.6 as a workaround. Definitively this is not the correct way bot this makes the job done.

@harshchawda - thanks so much for confirming a working version! I confirm that I too am able to work with 0.11.6

@stevengum @cwhitten - can you please provide an ETA on R11?

The fix in the underlying botframework-streaming library was completed in R11 and PR #323 contains the package bump to pickup botframework-streaming@4.11.0. @compulim how do you want to proceed?

@cwhitten, can you respond to an ETA on R11?

This missed the R11 window but can catch the next train--ETA February 2021.

Thanks for the update.... I'm not sure how to write a frown face in here..... all good

Fixed via #323.

The fix for resolving Node.js dependencies was just released in version 0.14.1 of botframework-directlinejs.