microsoft / microsoft/TypeScript-Sublime-Plugin

Yarn 2 compatibility/incompatibility?

Ouverte
#772 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
JavaScript
Étoiles
1.7k
Forks
236
Merge moyen
21 j 13 h
PR mergées (30 j)
1

Description

I'm trying to use this plugin with sublime and yarn 2, but ts "cannot find" imported modules (installed with yarn add for example).

Here are my sublime project settings:

{
	"folders": [
		{
			"path": "."
		}
	],

	"settings": {
		"typescript_tsdk": "${project_path}/.yarn/sdks/typescript/lib",

		"SublimeLinter.linters.eslint.executable": "${project_path}/.yarn/sdks/eslint/bin/eslint.js",
		"SublimeLinter.linters.eslint.selector": "source.ts, source.js - meta.attribute-with-value"
	}
}

I got eslint working perfectly with yarn 2, but not this plugin. This config here doesn't even seem to get picked up by the plugin for some reason? I know I'm probably missing something that needs to be done in order to specify the setting at the project level, but the docs for this plugin do not elaborate on the specifications of configuring via project settings.

When I specify typescript_tsdk in my main sublime settings however, then the setting does seem to get picked up (I know this because checking in the console reveals an error from this plugin). The setting gets picked up but it errors with

Error: Cannot find module '/Applications/Sublime Text.app/Contents/MacOS/${project_path}/.yarn/sdks/typescript/lib/tsserver.js'

for some reason it is appending my configured path to /Applications/Sublime Text.app/Contents/MacOS/???

I tried both using the project_path var, and also just a ./ prefix, and both produce the same error and do the same thing (append the path to /Applications/Sublime Text.app/Contents/MacOS/ on load). I'm deferring to the global config (instead of project settings like I originally intended) in order to try to just get it setup temporarily so I could do some work already, but I can't get that working either. Obviously it would be optimal to have it configured at the project level since not every project will use yarn 2/yarn cache though. Any help would be great! Thank you!

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par reproduire le problème avec les paramètres de projet Sublime affichés et le paramètre global typescript_tsdk, puis inspectez la sortie de la console Sublime pour la résolution du chemin de tsserver.js. Le travail est terminé lorsque les paramètres Yarn 2 au niveau du projet sont reconnus, que le chemin ne reçoit plus le préfixe d’installation de Sublime Text et que les modules importés sont résolus.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, typescript
Domaine
devtools, tooling
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.