-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Support TypeScript "moduleResolution": "node16"
#1522
Comments
#1522 - only force module/resolutionmode if not set to something valid by user - TS plugin: add new param to ts resolver to fix diagnostics not appearing
Hey @dummdidumm does this update for the language server need to be manually published to npm? Eager to try it out, but noticed NPM is listing it as 0.14.28 / updated 16 days ago. |
The fixed label means it's fixed on master but not released yet. when the issue is closed it's released. You could try it out yourself by building from source. the getting started instructions in the main readme if this repo should help with that |
Okay cool I tried it out but encountered an issue. It seems to honor my module resolution settings now, and that fixes the issue importing from a module that uses the new However, it seems to no longer understand svelte file imports. The problem may be unrelated / out of the scope of svelte-language-server, or even an issue with how I built it locally, I'm not sure, but figured it was worth noting here. As a base case I did a clean install of SvelteKit with the demo code and updated the tsconfig: "moduleResolution": "node16", Now in import Counter from '$lib/Counter.svelte';
And dropping the alias didn't solve the issue: import Counter from '../lib/Counter.svelte';
Note that in all cases the svelte project builds and runs fine. It's just the language server that's reporting errors. |
Thank you, not sure how that slipped through. Should be fixed now. |
Confirmed on my end. |
Description
In TypeScript 4.7, along the property
"module": "node16"
that enables ESM features in TypeScript, there are new values for the property"moduleResolution"
:"node16"
and"nodenext"
. Both values allows importing from dependencies with package.json exports, imports, and self-referencing. Right now, this property is hard-coded to"node"
.Proposed solution
The svelte-language-server shouldn't hard-code that property and instead read it from the
tsconfig.json
Alternatives
No response
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: