suren-atoyan / monaco-react

Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins
https://monaco-react.surenatoyan.com/
MIT License
3.81k stars 268 forks source link

[Bug] - Unable to refresh type definitions when using the same interface name #630

Closed doregg closed 5 months ago

doregg commented 5 months ago

Describe the bug I cannot refresh my type definitions when using setExtraLibs / dispose on addExtraLibs - when using the same interface name and same file path. My interface is dynamically loaded and can be refreshed because of user interaction. I can't refresh the type definition because of this bug.

To Reproduce

Steps to reproduce the behavior:

  1. Setup monaco editor with type definition, filePath: ts:filename/typings.d.ts
  2. Change type definition without changing the interface name with the same filePath ts:filename/typings.d.ts
  3. Get a type error (because interface is not getting refreshed) See code in the playground

Expected behavior monaco playground - there it works

Desktop (please complete the following information):

suren-atoyan commented 5 months ago

I tried to reproduce it and I don't see any issue. Please check this codesandbox

doregg commented 5 months ago

@suren-atoyan thanks for trying to reproduce My use case is much more complex than that (language javascript with a lot of typescript configurations). I tried to implement my use case in the code sandbox but I couldn't make it work like in my local. Let's close it for now and if I'll have more time to invest on it I'll re-open. Thanks

suren-atoyan commented 5 months ago

@suren-atoyan thanks for trying to reproduce My use case is much more complex than that (language javascript with a lot of typescript configurations). I tried to implement my use case in the code sandbox but I couldn't make it work like in my local. Let's close it for now and if I'll have more time to invest on it I'll re-open. Thanks

sounds good 🙌