TypeFox / monaco-components

Monaco Editor and Language Client Wrapper, plus Monaco Editor React Component
MIT License
42 stars 13 forks source link

New Problem in vite #55

Closed cdietrich closed 11 months ago

cdietrich commented 11 months ago

Hi, any hints how to solve

[vite]: Rollup failed to resolve import "vscode/service-override/configuration" from "/Users/dietrich/git/my-monaco-editor-react-example/node_modules/monaco-editor-wrapper/dist/editorAppBase.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
kaisalmen commented 11 months ago

Hi @cdietrich did you adjust your imports? See https://github.com/TypeFox/monaco-components/blob/main/packages/monaco-editor-wrapper/CHANGELOG.md#320---2023-09-29 : "Only keep user services ininitServices. It requires to specifically import and use services provided by monaco-vscode-api"

vscode/service-override/configuration" does no longer exist. Take a look at the examples.

cdietrich commented 11 months ago

i am using react, not wrapper directly. you can find my code at https://github.com/cdietrich/my-monaco-editor-react-example/tree/cd/tryBump

where is initServices in react?

https://github.com/cdietrich/my-monaco-editor-react-example/blob/f5f12fd337ebaaafcb0214dbcaa28c69e17e7228/src/App.tsx#L17

kaisalmen commented 11 months ago

Rollup failed to resolve import "vscode/service-override/configuration" from

I fixed an import problem in the 3.3.0 I thought I introduced in that branch only. Need to check if I overlooked here...

kaisalmen commented 11 months ago

where is initServices in react?

You pass on the config object. There is a little as possible logic in the react-editor.

cdietrich commented 11 months ago

https://github.com/TypeFox/monaco-components/blob/d7880556c4d69437a4ccd4ee071d48f4c21d32b0/packages/monaco-editor-wrapper/src/editorAppBase.ts#L5 does this need to be imported from '@codingame/monaco-vscode-configuration-service-override'

similar for the vscode/extension import

kaisalmen commented 11 months ago

does this need to be imported from '@codingame/monaco-vscode-configuration-service-override'

Yes, this is exactly the problem and I have no idea why the compiler didn't complain previously. 3.2.5 and 2.2.5 are available now where the problem is fixed.

3.3.0 will come early next week, I guess.

cdietrich commented 11 months ago

thx for the fix