Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Failed to get list of R functions: No method asJSON S3 class: NativeRoutineMap

Chiusa
#1,672 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
r, typescript

Direzione di ricerca

Riprodurre il malfunzionamento in un file R di VS Code su Windows 11 attivando il completamento automatico o l’hover, quindi esaminare l’avvio del processo languageserver dell’estensione e i r.lsp.args configurati. Confrontare il comportamento relativo a --vanilla, jsonlite e NativeRoutineMap e usare l’ambiente riportato come baseline. Il lavoro è completato quando l’errore di function-list non compare più durante il completamento automatico o l’hover.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug needs information

Description

When using the R extension, I consistently receive these error messages:

  1. Failed to get list of R functions. Make sure that jsonlite is installed and r.rpath.windows points to a valid R executable.

  2. R library paths: C:/R_libs/4.5 C:/Program Files/R/R-4.5.2/library Error: No method asJSON S3 class: NativeRoutineMap

The error occurs even when just selecting lines of code in the editor (without executing), suggesting it's triggered by autocomplete/hover features.

Environment

  • OS: Windows 11 x64
  • VS Code version: (1.107.1)
  • vscode-R extension version: 2.8.6
  • R version: 4.5.2 (2025-10-31 ucrt)
  • jsonlite version: 2.0.0
  • languageserver version: 0.3.16

Attempted fixes (none worked)

  1. Added S3 method fix for asJSON.NativeRoutineMap in:

    • ~/.Rprofile
    • Rprofile.site (R's site profile)
    • OneDrive shared .Rprofile
  2. Set R_PROFILE_USER as system environment variable

  3. Configured r.lsp.args: ["--no-save", "--no-restore"]

  4. Reinstalled languageserver from GitHub (remotes::install_github)

  5. Updated jsonlite to 2.0.0

Root cause hypothesis

The languageserver appears to run with --vanilla flag internally, which skips all profile files including Rprofile.site. This prevents any runtime fix from being applied before jsonlite encounters the NativeRoutineMap class.

Suggested fix

Either:

  1. Don't use --vanilla when spawning the languageserver R process, or
  2. Add a built-in handler for NativeRoutineMap class in the extension/languageserver
  3. Use force = TRUE in jsonlite calls (similar to fix in PR #1255)

Minimal reproducible example

The error occurs on any R file when the extension tries to provide autocomplete suggestions.

Lingua principale
TypeScript
Stelle
1.2k
Fork
139
Merge medio
22h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di REditorSupport/vscode-R

Tutte le issue di REditorSupport/vscode-R

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.