Vite: Warnings on console from renderMarkdown sanitize-html dependency
Is it an issue related to Adaptive Cards?
No
Is this an accessibility issue?
No
What version of Web Chat are you using?
Latest production
Which distribution are you using Web Chat from?
NPM
Which hosting environment does this issue primarily affect?
Others or unrelated
Which browsers and platforms do the issue happened?
Others or unrelated
Which area does this issue affect?
Others or unrelated
What is the public URL for the website?
No response
Please describe the bug
Our project is a React SPA app and we use Vite (v4.4.4) for building. We use the default markdown which is exported as renderMarkdown botframework-webchat.
Running the application results to following warning on console:
Module <X> has been externalized for browser compatibility. Cannot access <X.Y> in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Affected modules are:
- path
- fs
- url
- source-map-js All of these are originated from renderMarkdown.ts dependency of sanitize-html.
Do you see any errors in console log?
Only warnings
How to reproduce the issue?
- Create new project with Vite
- Install botframework-webchat from NPM
- Include in project and implement some chat using the default renderMarkdown function
- Run using npm run vite
Our setup is this, but I would expect the warnings to appear with any usage of the function:
import { createDirectLine, Components, renderMarkdown, } from 'botframework-webchat'<Components.Composer directLine={createDirectline({token:token})} renderMarkdown={renderMarkdown} ><Components.BasicWebChat/></Components.Composer>
What do you expect?
No warnings
What actually happened?
Warnings as stated above
Do you have any screenshots or recordings to repro the issue?
Adaptive Card JSON
No response
Additional context
No response
AFAIK, there are dependencies outside of Web Chat that imported external and browserify them.
If they are from sanitize-html, could you file the issue to them? We will uptake their latest version when they have resolved the issue.