swagger-api / swagger-editor

Swagger Editor
https://editor.swagger.io
Apache License 2.0
8.95k stars 2.26k forks source link

Error when trying to launch a project for local development #5302

Open xzdwq opened 1 week ago

xzdwq commented 1 week ago

Q&A (please complete the following information)

Content & configuration

I am trying to run swagger-editor-next locally I followed the startup instructions:

 $ git submodule init
 $ git submodule update
 $ npm i
 $ npm start

and I got an error:

ERROR in ./src/plugins/editor-monaco/components/MonacoEditor/MonacoEditor.jsx 8:0-40
Module not found: Error: You attempted to import /node_modules/monaco-editor which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules/.

I also checked:

npm ls monaco-editors

swagger-editor@5.0.0-alpha.96 C:\Users\zhivovi\develop\swagger-editor
+-- monaco-editor@npm:@codingame/monaco-vscode-editor-api@5.2.0
`-- react-scripts@5.0.1 -> .\create-react-app\packages\react-scripts
  `-- monaco-editor@npm:@codingame/monaco-vscode-editor-api@5.2.0 deduped

And I tried npm dedupe but the mistake remained the same

I know that these are the features of react-create-app, but I'm not sure that I should somehow solve this through overrides

Screenshots

image

image