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

[Dev support]: Unable to build TS project with typescript < 5.3.0 #2050

Open
blackchoey opened this issue Sep 24, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working dev support Dev support tracking

Comments

@blackchoey
Copy link
Contributor

Question

Right now projects using typescript < 5.3.0 will meet build failure if the project references Teams-AI library. Seems the recent MSAL-JS library release causes this issue. However, the botbuilder sdk does not have similar build failures, though it also references MSAL.

Though higher typescript version seems be able to fix the build errors. I'm raising this question to see whether some changes (e.g. tsconfig, etc.) are required in Teams-AI to avoid such kind of errors, so users with lower typescript version (like an existing project developed earlier) won't meet the error.

Here're the sample error message:

> echobot-demo@1.0.0 build
> tsc --build

node_modules/@azure/msal-common/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`.

...

 
And here're the repro steps:

  1. Copy the JS echo bot sample out of the repo
  2. Change the typescript version to an older one like 5.2.2
  3. Run npm install and npm run build command under the echo bot project's root folder. You will see the build failure.

Code snippets

N/A

What you have tried already

Here're current observations:

  1. MSAL changes moduleResolution and module compiler options to nodenext
  2. Starting from TypesScript 5.3.0, resolution-mode supported in all module modes which seems solved the issue from compiler perspective. https://devblogs.microsoft.com/typescript/announcing-typescript-5-3/
  3. There is no similar issue for bot built with botbuilder packages. We haven't found why there's no problem with botbuilder.

Note: please use this template to file your questions regarding implementation. Once your question is answered, our team will move this question to Q&A in Discussions for findability.

@blackchoey blackchoey added the dev support Dev support tracking label Sep 24, 2024
@corinagum
Copy link
Collaborator

corinagum commented Sep 25, 2024

Hey @blackchoey, thanks for the FYI. To note, I have a PR that will be updating our tsconfigs to ESNext: #2034 (I hadn't realized that we weren't using ESNext in the samples).

With these changes I'll test out echobot and get back to you.

@corinagum corinagum self-assigned this Sep 25, 2024
@corinagum corinagum added the bug Something isn't working label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev support Dev support tracking
Projects
None yet
Development

No branches or pull requests

2 participants