Skip to content

Image without ?enhanced fails only in production and not development #15334

@sukeshpabolu

Description

@sukeshpabolu

Describe the bug

Build created with @sveltejs/enhanced-img and rolldown-vite (or vite 8@beta) is failing to run.

Reproduction

<script>
	import MyImage from '$lib/assets/tama66-typewriter-8622984_1280.jpg';
</script>

<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
<enhanced:img src={MyImage} alt="Typewriter by the window" />

https://github.com/sukeshpabolu/enhanced-img-bug

  • install build
  • run pnpm build or npm build
  • run pnpm preview or npm preview

Logs

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
    Memory: 3.99 GB / 15.73 GB
  Binaries:
    Node: 22.22.0 - C:\Users\abcdefg\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Users\abcdefg\nodejs\yarn.CMD
    npm: 10.9.4 - C:\Users\abcdefg\nodejs\npm.CMD
    pnpm: 10.29.3 - C:\Users\abcdefg\nodejs\pnpm.CMD
    bun: 1.3.8 - C:\Users\abcdefg\.bun\bin\bun.EXE
    Deno: 2.5.4 - C:\Users\abcdefg\.deno\bin\deno.EXE
  Browsers:
    Edge: Chromium (143.0.3650.80)
    Firefox: 133.0.3 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.19041.5794
  npmPackages:
    @sveltejs/adapter-node: ^5.5.3 => 5.5.3
    @sveltejs/enhanced-img: ^0.10.2 => 0.10.2
    @sveltejs/kit: ^2.52.0 => 2.52.0
    @sveltejs/vite-plugin-svelte: 7.0.0-next.0 => 7.0.0-next.0
    svelte: ^5.51.3 => 5.51.3
    vite: 8.0.0-beta.13 => 8.0.0-beta.13

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions