Skip to content

Possible alias collisions with $internal/paths after 1.4.0+ (#8838) #9009

Closed
@jrmoynihan

Description

@jrmoynihan

Describe the bug

Upon building my app, this error is thrown both locally, and by Vercel's build process:

Error: Could not load /vercel/path0/src/lib/internal/paths (imported by node_modules/.pnpm/@sveltejs+kit@1.5.5_svelte@3.55.1+vite@4.1.1/node_modules/@sveltejs/kit/src/runtime/server/respond.js): ENOENT: no such file or directory, open '/vercel/path0/src/lib/internal/paths'

The import is performed here:
CleanShot 2023-02-11 at 20 56 04@2x

Which traces back to this type declaration:
CleanShot 2023-02-11 at 20 56 59@2x

I have an alias in my SvelteKit package's project to $internal which I think conflicts with the changes made by @benmccann in #8838 ?

I can rename my alias to solve the problem, but I think this could pop up again for any other library author using that naming scheme in their aliases. It might be worth reverting to the actual paths rather than the aliased ones, or using something more unlikely to have conflicts like e.g. $$internal_.

Reproduction

Provide an alias named $internal to config.kit.alias within a SvelteKit project. Run vite build.

Logs

No response

System Info

System:
    OS: macOS 12.6.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 137.69 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
    npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.119
    Firefox Developer Edition: 109.0
    Safari: 16.2
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.0.0 
    @sveltejs/kit: ^1.5.5 => 1.5.5 
    @sveltejs/package: ^1.0.2 => 1.0.2 
    svelte: ^3.55.1 => 3.55.1 
    vite: ^4.1.1 => 4.1.1

Severity

serious, but I can work around it

Additional Information

Solved by changing the $internal alias used within my own project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions