-
Notifications
You must be signed in to change notification settings - Fork 14
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
Export Menu10 to avoid TS4058 #40
Comments
Please see my PR: #41 |
Hey @sethidden! I noticed that you did not import type Content from "@bloomreach/spa-sdk". Is there a reason for this? |
@hachok Hello, I've made a repo with a repro case. One liner for repro should be: Or you can just see the code at https://github.com/sethidden/bloomreach-spa-sdk-is40-repro.git
|
I see that the issue does not occur when |
Unfortunately it's not possible in our case. Our package is a library that uses @bloomreach/spa-sdk underneath, and we can't set noEmit to true because otherwise the d.t.s files would not be generated for the library. |
I see! I'll add your #41 change in the next release @bloomreach/spa-sdk@23.3.1 and will notify you once it's released. |
@bloomreach/spa-sdk@23.3.1 has been released, containing the fix! |
Just updated and everything is working correctly. Thanks for taking care of this. |
Here you're defining Menu:
spa-sdk/packages/spa-sdk/src/page/menu.ts
Line 51 in 2b4336e
And here you're using it:
https://github.com/bloomreach/spa-sdk/blob/2b4336e0b45f0fbf92cc8136147d5253ea8fce9a/packages/spa-sdk/src/page/
menu.ts#L113
The problem is that if you have code like this in TypeScript 5.5:
You'r run into error TS4058 saying:
The problem here is that somewhere in the code there's another interface named Menu, because the interface in isMenu is Menu$2:
The resolution to this TS4058 error would be to import { Menu$2 } from '@bloomreach/spa-sdk' however I can't do that because it's not exported.
Please rename the interfaces so their names don't clash (There's Menu, Menu$1 and Menu$2) so they clash two times and export them
The text was updated successfully, but these errors were encountered: