Closed fcarsana closed 9 months ago
For the websocket server (https://github.com/PseudocodeEditor/eval):
$ poetry install
$ python3 main.py
For the editor (https://github.com/PseudocodeEditor/editor):
codemirror6/editor/run/websocket.js
to the url of your websocket server$ npm install
$ npx rollup -c
$ node index.js
If you want to run these specifically in a Docker container, I would recommend looking up a general Docker guide.
I'm receiving the following error trying to bundle the files:
$ npx rollup -c
(node:72361) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ...
to show where the warning was created)
[!] RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.
Original error: Cannot use import statement outside a module https://rollupjs.org/command-line-interface/#bundleconfigascjs /editor/rollup.config.js:1 import typescript from "rollup-plugin-ts"; ^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:345:17)
at ModuleWrap.
What version of node and npm are you using?
$ npm --version 10.2.3 $ node --version v20.10.0
Ah, I forgot to say to import the packages. Run npm install
.
I think it's working: thank you!
$ npx rollup -c Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
codemirror6/editor/editor.js → dist/editor.bundle.js... (!) Circular dependency codemirror6/editor/extensions/themes.js -> codemirror6/editor/extensions/extensions.js -> codemirror6/editor/extensions/shortcuts.js -> codemirror6/editor/files/delete.js -> codemirror6/editor/extensions/themes.js created dist/editor.bundle.js in 1.5s
$ node server.js Server listening on PORT 8080
Just to let you know @fcarsana, https://editor.pseudonaja.app now runs entirely client side, so there is no longer any waiting in the queue.
Can you provide a guide on running PseudocodeEditor in a cotanier, please? I would like to run my own editor just to not be stucked in the execution queue. Thank you.