Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Extension fails to start with TypeError #776

Open
rightpad opened this issue Nov 3, 2021 · 4 comments
Open

Extension fails to start with TypeError #776

rightpad opened this issue Nov 3, 2021 · 4 comments
Assignees
Labels
bug Bug reports

Comments

@rightpad
Copy link

rightpad commented Nov 3, 2021

Your environment

  • vscode-ruby version: 0.28.1
  • Ruby version: 3.0.2
  • Ruby version manager (if any): asdf
  • VS Code version: 1.61.2
  • Operating System: Linux 5.14.15 kernel x86_64
  • Using language server? (eg useLanguageServer is true in your configuration?) No

Expected behavior

For linting and formatting to work in a new rails project with standardrb.

Actual behavior

The extension fails to start when opening a Ruby file in a new Rails project. The extension host log window gives the following output:

[2021-11-03 13:23:50.173] [exthost] [error] TypeError: u[t] is not a constructor
	at c._runLinters (/home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:9:100387)
	at c.run (/home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:9:98899)
	at t.LintCollection.run (/home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:9:97999)
	at r (/home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:9:94677)
	at Array.forEach (<anonymous>)
	at Object.t.registerLinters (/home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:9:95207)
	at /home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:1:78681
	at Generator.next (<anonymous>)
	at /home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:1:77907
	at new Promise (<anonymous>)
	at r (/home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:1:77655)
	at t.activate (/home/aries/.vscode/extensions/rebornix.ruby-0.28.1/dist/client/ruby.js:1:78420)
	at Function._callActivateOptional (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:99:15028)
	at Function._callActivate (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:99:14704)
	at /opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:99:12907
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async Promise.all (index 1)

My ruby VSCode config:

  "ruby.codeCompletion": false,
  "ruby.useLanguageServer": false,
  "ruby.intellisense": false,
  "ruby.useBundler": true,
  "ruby.format": "standard",
  "ruby.lint": {
    "standard": true
  },
  "[ruby]": {
    "editor.tabSize": 2,
    "editor.insertSpaces": true,
    "editor.defaultFormatter": "rebornix.ruby"
  },

My Gemfile is a standard new Rails 6.1.4.1 project with the standard gem added to the Gemfile.

@lucasprag
Copy link

I'm also having the same problem.

My settings are just:

"ruby.lint": {
  "standard": true
},

However, if I use rubocop, it works and I can see linting warnings on my code.

"ruby.lint": {
  "rubocop": true
},

I tried removing all ruby related extensions and others as well.

@lucasprag
Copy link

lucasprag commented Dec 17, 2021

Hey @wingrunr21 and @rebornix, is there anything I can do to help with this issue? 🙏

I tried building the project locally following the instructions on developing.md#getting-started, but I get this error:

wasm

It sounds like this dependency might be wrong. I think that's the case because I can't find a package called "web-tree-sitter-ruby" on npm. However I'm able to find one called tree-sitter-ruby and it even matches the most recent version on your package.json, which is 0.19.0, but I'm not sure exactly what is happening 🤔

@wingrunr21
Copy link
Collaborator

web-tree-sitter-ruby is in the packages directory. It isn't wrong 😉

@wingrunr21 wingrunr21 self-assigned this Jan 3, 2022
@wingrunr21 wingrunr21 added the bug Bug reports label Jan 3, 2022
@navels
Copy link

navels commented Apr 4, 2022

I got hit with this today as well.

Update: ah, I had rebuilt my dev container and hadn't yet run bundle install :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug reports
Projects
None yet
Development

No branches or pull requests

4 participants