skeleton icon indicating copy to clipboard operation
skeleton copied to clipboard

LSP-SUGAR: typescript language server raises skeleton module found but not resolved in tailwind.config.ts

Open Haiz14 opened this issue 1 year ago • 2 comments

Current Behavior

This error doesn't affect the working of skeleton, only the lsp complains.

Follow reproducing section, and an error like this will be raised by typescript server language server.

 │     Cannot find module '@skeletonlabs/skeleton/plugin' or its corresponding type declarations. typescript (2307) [3, 26]
 │        There are types at '/data/data/com.termux/files/home/teste-skeleton-next/node_modules/@skeletonlabs/skeleton/dist/plugin/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. 

Typescript language server version ❯ typescript-language-server --version 4.3.3

Expected Behavior

LSP shouldn't raise this error.

Steps To Reproduce

  1. Standard installation of skeleton-next sveltekit via https://next.skeleton.dev/docs/get-started/installation/sveltekit
  2. Final tailwind.config.ts should be something like
import type { Config } from 'tailwindcss';
import { join } from 'path';
import { skeleton } from '@skeletonlabs/skeleton/plugin';
import * as themes from '@skeletonlabs/skeleton/themes';

export default {
	content: [
		'./src/**/*.{html,js,svelte,ts}',
		join(require.resolve('@skeletonlabs/skeleton-svelte'), '../**/*.{html,js,svelte,ts}')
	],

	theme: {
		extend: {}
	},

	plugins: [
		skeleton({
			themes: [
				themes.rose,
				themes.cerberus,
			],
		})
	]
} as Config;
  1. Check your typescript lsp errors. It should show the expected error.

Link to Reproduction / Stackblitz

No response

More Information

tsconfig.json 's modupeResolution is bundler

Haiz14 avatar Oct 17 '24 06:10 Haiz14

not reproducible in vscode, should i close it? It only occurs in my neovim lsp.

Haiz14 avatar Oct 17 '24 09:10 Haiz14

@Haiz14 we'll leave it for now for documentation sake.

endigo9740 avatar Oct 17 '24 14:10 endigo9740

I have a similar thing in VS-Code

Bildschirmfoto 2024-10-28 um 17 32 58

Xenon27 avatar Oct 28 '24 16:10 Xenon27

@Haiz14 @Xenon27 I was able to replicate a similar issue last week when testing Skeleton for a Next.js project with Turbopack enabled. Can the two of you confirm which framework you're using.

  1. SvelteKit | Next.js | other
  2. If Next.js are you using Turbopack: Yes/No

EDIT Haiz I see you linked to the SvelteKit docs, so I'm going to assume this is what you were using. But I'll let you confirm.

endigo9740 avatar Oct 28 '24 17:10 endigo9740

I am using SvelteKit

Xenon27 avatar Oct 28 '24 17:10 Xenon27

Sveltekit

Haiz14 avatar Oct 29 '24 05:10 Haiz14

Same error: Cannot find module '@skeletonlabs/skeleton/plugin' or its corresponding type declarations.

With SvelteKit. Skeleton v3 beta.

slythom avatar Nov 06 '24 21:11 slythom

Just FYI folks, we've made some headway on this. We have a PR pending. We'll test and release a patch asap:

  • https://github.com/skeletonlabs/skeleton/pull/2931

endigo9740 avatar Nov 06 '24 21:11 endigo9740

@Haiz14 @Xenon27 @slythom we've just pushed out an update to the core package. That should be:

@skeletonlabs/skeleton 3.0.0-next.7  

If you guys would please update and verify this resolves things on your end.

If you're using VS Code, make sure to restart the local environment. You can do this with shift + control + P on Windows. Either of the first two options should work.

Screenshot 2024-11-07 at 1 40 01 PM

If all else fails just restart VS Code.

endigo9740 avatar Nov 07 '24 19:11 endigo9740

Everything is fine now! Well done, thanks!! And I didn't need to restart the local environment.

slythom avatar Nov 07 '24 20:11 slythom

Glad to hear! We'll await confirmation from a couple other folks before we close out the issue.

endigo9740 avatar Nov 07 '24 20:11 endigo9740

We've had a number of folks confirm this fix on Discord, so I'm going go ahead and close this out. Thanks!

endigo9740 avatar Nov 08 '24 16:11 endigo9740