sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
864 stars 105 forks source link

@sveltejs/vite-plugin-svelte-inspector version is missing spacing around "||" causing errors in Bun #984

Closed skdev-io closed 2 months ago

skdev-io commented 2 months ago

Describe the bug

The version info for @sveltejs/vite-plugin-svelte-inspector is currently "^3.0.0-next.0||^3.0.0" but should be "^3.0.0-next.0 || ^3.0.0" for it to work properly with Bun.

Reproduction URL

https://github.com/sveltejs/vite-plugin-svelte/

Reproduction

1) Try "bun install" 2) Receive error

Logs

error: No version matching "^3.0.0-next.0||^3.0.0" found for specifier "@sveltejs/vite-plugin-svelte-inspector" (but package exists)

System Info

System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 4.01 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.5.0 - /opt/homebrew/bin/node
    npm: 10.2.4 - /opt/homebrew/bin/npm
    bun: 1.1.7 - ~/.bun/bin/bun
  Browsers:
    Edge: 128.0.2739.79
    Safari: 17.6
    Safari Technology Preview: 18.0
  npmPackages:
    @sveltejs/adapter-auto: ^3.2.4 => 3.2.4 
    @sveltejs/kit: ^2.5.27 => 2.5.27 
    @sveltejs/vite-plugin-svelte: ^4.0.0-next.7 => 4.0.0-next.7 
    svelte: ^5.0.0-next.246 => 5.0.0-next.246 
    vite: ^5.4.5 => 5.4.5
skdev-io commented 2 months ago

https://github.com/sveltejs/vite-plugin-svelte/pull/983

bluwy commented 2 months ago

If it's a Bun only issue, shouldn't it be reported to Bun? The version format looks like valid semver to me.

dominikg commented 2 months ago

there are about 3.5k package.json files on github using the spaceless version and https://semver.npmjs.com shows it works without. The spec mentions 2 versions must be separated by space, and the || is shown surrounded by space but it is a different separator.

That being said, we should make a mental note to use the spaced version next time. The current || is going to be removed once we release 3.0 final, which is going to be alongside the svelte5 release.

Kapsonfire-DE commented 2 months ago

If it's a Bun only issue, shouldn't it be reported to Bun? The version format looks like valid semver to me.

yeah npm allows the use of non-spaced version and I think bun should make it support as well (and it will support it im very sure). but to be spec compliant its better to make the space.

Jarred-Sumner commented 2 months ago

I think this is a bug in Bun

cc @dylan-conway

dylan-conway commented 2 months ago

Yes, this was a bug in bun. It was fixed in bun v1.1.11 with https://github.com/oven-sh/bun/pull/11387

dominikg commented 2 months ago

thanks for the quick fix!!