Tamim468 / Monaco-LSP

Featuring a monaco editor with language client which connects the editor to luau language server from johnnymorganz!
4 stars 3 forks source link

Gets this error when running `npm run dev` in the server directory. #4

Open TERIHAX opened 1 year ago

TERIHAX commented 1 year ago
D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'.

    at createTSError (D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\index.ts:859:12)
    at reportTSError (D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\index.ts:863:19)
    at createFromPreloadedConfig (D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\index.ts:874:36)
    at phase4 (D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\bin.ts:543:44)
    at bootstrap (D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\bin.ts:95:10)
    at main (D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\bin.ts:55:10)
    at Object.<anonymous> (D:\Downloads\Monaco-LSP-main\node_modules\ts-node\src\bin.ts:800:3)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Module.load (node:internal/modules/cjs/loader:1113:32) {
  diagnosticCodes: [ 6046 ]
}
[nodemon] app crashed - waiting for file changes before starting...
moleium commented 1 year ago

create tsconfig.json and put that

{
  "compilerOptions": {
    "module": "commonjs"
  }
}
TERIHAX commented 1 year ago

@MoleSchizo it works now but when I run it on a linux replit instance, and then run the server, the page just returns "Upgrade Required"

moleium commented 1 year ago

@TERIHAX Default editor port is open at localhost:3000. Are you visiting the LSP port instead of the editor client port? because that's what shows if you do so

TERIHAX commented 1 year ago

@MoleSchizo Yes I am running them separately, the client first, then the server, but I change the vite.config.js file to:

import { defineConfig } from 'vite'

export default defineConfig({
  resolve: {
    alias: {
      vscode: '@codingame/monaco-languageclient/lib/vscode-compatibility',
    },
  },
  server: {
    host: '0.0.0.0',
  }
})

so it would run in the replit url, https://monaco-lsp.terihax.repl.co, but when I go to https://monaco-lsp.terihax.repl.co:3000, it's just stuck loading forever.

moleium commented 1 year ago
export default defineConfig({
  server: {
    host: '0.0.0.0',
    port: '8080'
  },
  resolve: {
    alias: {
      vscode: '@codingame/monaco-languageclient/lib/vscode-compatibility',
    },
  },
})

Monaco will start like that, but for some reason, it will fail connecting to the language server protocol, its 100% problem with the configuration, So you got to find a way to do that in repl.it :)

Also, it will surely run fine using services like railway.app but it has some free usage limit