microsoft / microsoft/BotFramework-WebChat
CommonJS 4.17.0 Issue - EJS botframework-webchat-api
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 1.6k
- Avg merge
- 22h 58m
- Merged PRs (30d)
- 2
Description
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?
Web apps
Which browsers and platforms do the issue happened?
Others or unrelated
Which area does this issue affect?
Others or unrelated
Which theme pack does this issue affect?
I did not test it on other theme packs
What is the public URL for the website?
No response
Please describe the bug
I'm using a TS project with webpack. It is using commonjs. 4.16.0 works perfectly fine but as soon as I switch to the latest 4.17.0, I get runtime errors in the console in the browser because it is trying to use .mjs files. I also saw this PR and thought it would fix it so I tried the latest main version: 4.17.1-main.20240708.c9247bf.
Do you see any errors in console log?
botframework-webchat-api.mjs:1 Uncaught (in promise) TypeError: i is not a function
at botframework-webchat-api.mjs:1:23790
at chunk-4ZIUY4G5.mjs:1:182
at ./node_modules/botframework-webchat-api/dist/botframework-webchat-api.mjs (botframework-webchat-api.mjs:139:43590)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/botframework-webchat-component/dist/botframework-webchat-component.mjs (botframework-webchat-component.internal.mjs:3:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/botframework-webchat/dist/chunk-EZUR2UAI.mjs (botframework-webchat.mjs:3:1)
at __webpack_require__ (bootstrap:24:1)
How to reproduce the issue?
As as you load it in the browser.
What do you expect?
For the page to load and crash to not occur.
What actually happened?
Crashes with console error
Do you have any screenshots or recordings to repro the issue?
N/A
Adaptive Card JSON
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash using a TypeScript project with webpack and CommonJS, starting from the botframework-webchat-api.mjs entry point and the related botframework-webchat-component.mjs stack frames. Compare the 4.16.0 package with 4.17.0 and the referenced PR 5231; done means the page loads without the reported runtime error under the stated setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100