8000 Imports broken with library updated to svelte-package v2 · Issue #9114 · sveltejs/kit · GitHub
[go: up one dir, main page]

Skip to content
Imports broken with library updated to svelte-package v2 #9114
@seanlail

Description

@seanlail

Describe the bug

I updated a lib to use svelte-package v2.

Previously I was using the lib like this:

<script lang="ts">
  import { Button } from "kit-issue-9114";
</script>

<Button>Example</Button>

After updating I get an error from TS that the module does not exist.
I found that if I add the output directory to the import, then it works:

Example:

<script lang="ts">
  import { Button } from "kit-issue-9114/package";
</script>

<Button>Example</Button>

I'm not sure where the issue is here, I used the migration script and have gone through this doc.

Reproduction

https://github.com/seanlail/kit-issue-9114

Logs

Cannot find module 'kit-issue-9114' or its corresponding type declarations.ts

System Info

System:
    OS: macOS 13.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 3.45 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
    npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
  Browsers:
    Chrome: 110.0.5481.100
    Firefox: 99.0.1
    Safari: 16.2
  npmPackages:
    @sveltejs/adapter-static: 2.0.1 => 2.0.1 
    @sveltejs/kit: 1.7.2 => 1.7.2 
    @sveltejs/package: 2.0.1 => 2.0.1 
    svelte: 3.55.1 => 3.55.1 
    vite: 4.1.2 => 4.1.2

Severity

serious, but I can work around it

Additional Information

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

      0