Open huiruo opened 2 months ago
I'm having the same issue with monaco-editor@0.51.0
.
I have deployed latest monaco-editor version 0.51.0
on the playground and it works there. Can you check ?
Hi @brijeshb42 , thank you for the help. I just realized the issue might also be related to the react version. Here is the package.json for your reference.
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@fontsource/roboto": "^5.1.0",
"@monaco-editor/react": "^4.6.0",
"@mui/icons-material": "^6.1.0",
"@mui/material": "^6.1.0",
"@tauri-apps/api": ">=2.0.0",
"@tauri-apps/plugin-cli": "~2",
"@tauri-apps/plugin-clipboard-manager": "^2.0.0",
"@tauri-apps/plugin-dialog": "~2",
"@tauri-apps/plugin-shell": ">=2.0.0",
"monaco-editor": "0.49.0",
"monaco-vim": "^0.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.6",
"uuid": "^10.0.0"
},
"devDependencies": {
"@tauri-apps/cli": ">=2.0.0",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/uuid": "^10.0.0",
"@vitejs/plugin-react": "^4.2.1",
"typescript": "^5.6.3",
"vite": "^5.4.8"
}
I suspect the react version might be too high. Could you help verify that? The repo of my project using monaco-vim is here. It's a tauri app. You may run the following commands to build it, after setting up the tauri dev env.
pnpm install
pnpm tauri dev
You may also refer to the workflows for detail.
Thank you!
monaco-vim has nothing to do with React. If you think react is the issue, please provide a repo or codesandbox with minimal reproduction. Otherwise it seems to be an issue with your setup.
I wonder as @monaco-editor/react
is used, it might bring some side effects. The setup doesn't seem to be wrong to me because in the repo I provided "monaco-editor": "0.49.0"
works with a minor defect (the cursor is not changed to a block in the normal mode), but "monaco-editor": "0.51.0"
only works in the normal mode as @huiruo reported. The only change is as follows.
- "monaco-editor": "0.49.0"
+ "monaco-editor": "0.51.0"
It is not effective in monaco-editor@0.51.0 (insert mode cannot be enabled), but it is effective in version 0.49.0 and can be used normally