You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is not a bug report. (please use a different template for reporting a bug)
This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description
Hi!
Thank you for creating this incredible piece of editor to be used for web applications. It is a very useful and nice way to provide source code input to users.
However, I noticed when using TypeScript code the user gets a Cannot find module 'foo'. error every time they import something. AFAIK This is intended behaviour and to fix this the website should provide the type definitions via addExtraLib or something else.
But when the website can't reasonably predict what kind of library the user is going to use they cannot provide the type definition for Monaco editor to use and feeding every possible type definition is practically impossible.
So here's the idea: Let's fetch them from the web. Using unpkg or other CDN providers we can fetch type definition on-the-fly. We could inspect the package.json or the import path to what type definition should we use.
This discussion was converted from issue #2965 on March 10, 2023 14:37.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Context
Description
Hi!
Thank you for creating this incredible piece of editor to be used for web applications. It is a very useful and nice way to provide source code input to users.
However, I noticed when using TypeScript code the user gets a
Cannot find module 'foo'.
error every time theyimport
something. AFAIK This is intended behaviour and to fix this the website should provide the type definitions viaaddExtraLib
or something else.But when the website can't reasonably predict what kind of library the user is going to use they cannot provide the type definition for Monaco editor to use and feeding every possible type definition is practically impossible.
So here's the idea: Let's fetch them from the web. Using unpkg or other CDN providers we can fetch type definition on-the-fly. We could inspect the
package.json
or the import path to what type definition should we use.Beta Was this translation helpful? Give feedback.
All reactions