Skip to content

Error: Could not find a declaration file for module #2634

@Bilge

Description

@Bilge

Describe the bug

Since Svelte v5, one (and only one) of my components gives this error. I cannot determine what is special about this one component, other than it declares no <script> block (but adding one does not fix the error).

  • This same file is unchanged since before the v5 migration, where svelte-check detected no error.
  • There are no errors with my webpack build.
  • The same file importing the problematic component also imports other components without problems.

This combination of circumstances makes me strongly suspect this is a bug.

Reproduction

import WatchListButton from '../component/WatchListButton.svelte';

Error: Could not find a declaration file for module '../component/WatchListButton.svelte'. 'component/WatchListButton.svelte' implicitly has an 'any' type.
import TooltipPage from './tooltip page';
import WatchListButton from '../component/WatchListButton.svelte';
import { mount } from 'svelte';

Expected behaviour

Components don't need declaration files, or such declarations are derived from the component source files.

System Info

  • OS: Windows
  • IDE: PhpStorm

Which package is the issue about?

svelte-check

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions