Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import createDirectLine, createStore in Typescript with v4.13 #3856

Closed
schemburkar opened this issue Apr 18, 2021 · 4 comments · Fixed by #3931
Closed

Unable to import createDirectLine, createStore in Typescript with v4.13 #3856

schemburkar opened this issue Apr 18, 2021 · 4 comments · Fixed by #3931
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. ExemptFromDailyDRIReport exempt from daily DRI report p0 Must Fix. Release-blocker
Milestone

Comments

@schemburkar
Copy link

Screenshots

file lib\index.d.ts from version v4.13.0 (left) vs v4.11.0 (right)

image

Version

NPM: v4.13.0

Describe the bug

The issue is present in the npm package botframework-webchat used in a react website (https://github.com/microsoft/BotFramework-WebChat/tree/master/packages/bundle/src)

The output lib folder contains a index.d.ts that is created using the new src\index.tsx and not src\index.ts. This is probably an issue with webpack output configuration in v4.13

Due to this the following line fails to compile in ts/vscode

import ReactWebChat, { createDirectLine, createStore } from 'botframework-webchat';

image

explicitly referencing lib/index.js does not work and is unable to recognize the exports.

Considering this work in v4.11.0, I would consider this a regression introduced in v4.13

Steps to reproduce

  1. Create react app using create react app
  2. Add package botframework-webchat v 4.13.0
  3. Import createDirectLine, createStore from 'botframework-webchat';
  4. See error

Expected behavior

The bundled package should support importing createDirectLine, createStore from 'botframework-webchat'

The above code works in v4.11.0.

Additional context

Suggest to rename the src\index.tsx added as part of PR #3818, creating a correct webpack output
The react samples in https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/01.getting-started/g.hybrid-react-npm/packages/chat-component have not been updated to v4.13 else they would showcase similar issues.

@schemburkar schemburkar added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete. labels Apr 18, 2021
@corinagum corinagum self-assigned this Apr 19, 2021
@corinagum
Copy link
Contributor

@schemburkar thanks for filing this bug. I'm adding to our list of R14 candidates.

@corinagum corinagum added the customer-replied-to Required for internal reporting. Do not delete. label Apr 19, 2021
@warunacds
Copy link

I know a fix for this issue is added R14, but for recording purposes, I want to mention here I'm having the same issue. By downgrading to 4.11.0 it will work on a typescript project.

@corinagum
Copy link
Contributor

@warunacds thanks, additional chime-ins help us with prioritization :)

@corinagum corinagum added this to the R14 milestone Apr 26, 2021
@tsuwandy tsuwandy added the ExemptFromDailyDRIReport exempt from daily DRI report label May 7, 2021
@corinagum
Copy link
Contributor

Related: #3908, #3909

@compulim I'm wondering if this has to do with comments on core/index.tsx

Marking this as P0 for immediate discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. ExemptFromDailyDRIReport exempt from daily DRI report p0 Must Fix. Release-blocker
Projects
None yet
5 participants