Botframework-webchat: Module not found: Can't resolve 'mime/types/other.json'

Created on 22 May 2019  ·  12Comments  ·  Source: microsoft/BotFramework-WebChat

Version

Latest - "botframework-webchat": "^4.4.1"

Describe the bug

npm install botframework-webchat, attempt to use:

import { DirectLine } from 'botframework-directlinejs';
import ReactWebChat from 'botframework-webchat';

and error message appears:

./node_modules/botframework-webchat-core/lib/utils/mime-wrapper.js
Module not found: Can't resolve 'mime/types/other.json'

This happens in brand new "create-react-app" and next.js projects.

To Reproduce

As above, create new react app using create-react-app, npm install botframework-webchat, import components required, start react "npm run start"

Expected behavior

The webchat works and renders

Additional context

[Bug]

Bug front-burner

Most helpful comment

It works for me @RoSchoe, if you need a hotfix, change the mime-wrapper.js to reflect this file https://github.com/microsoft/BotFramework-WebChat/blob/master/packages/core/src/utils/mime-wrapper.js#L40

All 12 comments

I've noticed fix #1998, so i npm install botframework-webchat@master, the problem still persists.

@tonyanziano

@Deucem can you check inside of your node_modules folder and see what version of Web Chat you have installed? You shouldn't be seeing the error for Can't resolve 'mime/types/other.json' because the code that was trying to require the .json files no longer exists.

This leads me to believe that you are still using an older version of Web Chat before the fix went in.

Ok yes that works, I nuked my node_modules folder and install the master branch and it came to live. Do you have an ETA on when this will be pushed to NPM, without having to have a dependency on the master branch? this is a pretty major breaking change that basically renders the webchat for react unusable.

Never mind, appears it was a local issue, the normal npm install botframework-webchat works just fine.

Glad to hear it!

I am seeing this too today. 🤦‍♂️

I believe mime bumped this breaking change (2.3.1 -> 2.4.3) and now our 4.4.1 is broken by default. Will let you guys know when we decided to publish 4.4.2 with Tony's fix to lock down on their version.

On the other hand, we modified npm install botframework-webchat@master. #2025 is the work to update our instructions.

Work to do

Bump to 4.4.2 with Tony's fix.

Hi is there an hotfix or workaround for that?

It works for me @RoSchoe, if you need a hotfix, change the mime-wrapper.js to reflect this file https://github.com/microsoft/BotFramework-WebChat/blob/master/packages/core/src/utils/mime-wrapper.js#L40

well done @jusso-dev , this solved my problem - thank you

Testing the patch on a local build, hopefully for a release today.

Released on NPM as 4.4.2 just now. Release on CDN is pending but since we burn-in packages, shouldn't be much different.

Thanks for reporting, @deucem. And thanks for workaround-ing the problem, @jusso-dev and @RoSchoe.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

compulim picture compulim  ·  3Comments

mmalaiarasan-conga picture mmalaiarasan-conga  ·  3Comments

AndreMantas picture AndreMantas  ·  4Comments

filipjakov picture filipjakov  ·  4Comments

corinagum picture corinagum  ·  3Comments