Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when starting language server #47

Closed
demaisj opened this issue Sep 17, 2024 · 1 comment
Closed

Crash when starting language server #47

demaisj opened this issue Sep 17, 2024 · 1 comment
Assignees

Comments

@demaisj
Copy link

demaisj commented Sep 17, 2024

Description of the bug

The prisma language server crashes when starting.

The error in the log indicates that the bin.js file doesn't exists.
After some investigation, I found that since @prisma/language-server 5.15.0, the bin.js file is not in dist/src anymore but dist.

A simple fix would then be in plugin.py:

  server_binary_path = os.path.join(
      server_directory,
      "node_modules",
+    "@prisma", "language-server", "dist", "bin.js"
-    "@prisma", "language-server", "dist", "src", "bin.js"
  )

Shall I do a PR for that?

Steps to reproduce

  1. Fresh install LSP-prisma
  2. Open a prisma schema file
  3. Wait for the language server to install
  4. The language server should start
  5. Popup shows up telling the language server keeps crashing

Expected behavior

It should correctly start the language server

Actual behavior

The language server doesn't start.

Troubleshooting information from LSP.

LSP Troubleshoot server: LSP-prisma output

Troubleshooting: LSP-prisma

Version

  • LSP: 2.2.0
  • Sublime Text: 4180

Server Test Run

  • exit code: 1
  • output
node:internal/modules/cjs/loader:1228
  throw err;
  ^

Error: Cannot find module '/home/user/.cache/sublime-text/Package Storage/LSP-prisma/20.17.0/language-server/node_modules/@prisma/language-server/dist/src/bin.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.17.0

Server Configuration

  • command
[
  "${node_bin}",
  "${server_path}",
  "--stdio"
]
  • shell command
/home/user/.nvm/versions/node/v20.17.0/bin/node "/home/user/.cache/sublime-text/Package Storage/LSP-prisma/20.17.0/language-server/node_modules/@prisma/language-server/dist/src/bin.js" --stdio
  • selector
source.prisma
  • priority_selector
source.prisma
  • init_options
{}
  • settings
{}
  • env
{
  "PATH": "/home/user/.nvm/versions/node/v20.17.0/bin:"
}

Active view

  • File name
/home/user/project/prisma/schema.prisma
  • Settings
{
  "auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
  "lsp_active": null,
  "syntax": "Packages/Prisma/resources/syntax/Prisma.sublime-syntax"
}
  • base scope
source.prisma

Project / Workspace

  • folders
[
  "/home/user/project"
]
  • is project: True
  • project data:
{
  "folders": [
    {
      "path": "."
    }
  ]
}

LSP configuration

{
  "hover_highlight_style": "background",
  "lsp_code_actions_on_save": {
    "source.fixAll.eslint": true,
    "source.fixAll.ts": true,
    "source.organizeImports.ts": true
  },
  "lsp_format_on_save": true,
  "semantic_highlighting": true,
  "show_code_actions": "annotation",
  "show_code_lens": "phantom",
  "show_diagnostics_count_in_view_status": true,
  "show_inlay_hints": true
}

System PATH

  • /home/user/.nvm/versions/node/v20.17.0/bin
  • /home/user/.local/bin
  • /home/user/bin
  • /usr/local/bin
  • /usr/local/sbin
  • /usr/bin
  • /usr/sbin

LSP-prisma version

1.0.17

@UltraInstinct05
Copy link
Contributor

@demaisj Thanks for the bug report. I don't use Prisma myself anymore (but just update the language server version from time to time), so I missed this. This should be addressed in 1.0.18.

Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants