Skip to content

docs: (image preprocessor) update incorrect import statement #11014

@fubits1

Description

@fubits1

Describe the bug

The official SvelteKit documentation for the new image preprocessor (introduced with c52aab6) provides an incorrect example for the asset import statement:

<script>
  import { MyImage } from './path/to/your/image.jpg?enhanced';
</script>

This throws a 500 server error. Instead, the import statement should be:

<script>
  import MyImage from './path/to/your/image.jpg?enhanced';
</script>

Reproduction

https://github.com/fubits1/sveltekit-enhanced-img/blob/main/src/routes/%2Bpage.svelte

Logs

No response

System Info

System:
    OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 18.01 GB / 31.20 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 20.8.1 - ~/.nvm/versions/node/v20.8.1/bin/node
    npm: 10.2.2 - ~/.nvm/versions/node/v20.8.1/bin/npm
    pnpm: 8.10.2 - ~/.nvm/versions/node/v20.8.1/bin/pnpm
    bun: 1.0.7 - ~/.nvm/versions/node/v20.8.1/bin/bun
  Browsers:
    Brave Browser: 119.1.60.114
    Chrome: 120.0.6090.0
    Chromium: 119.0.6045.123

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationready to implementplease submit PRs for these issues!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions