Skip to content

[Vapor] Using image from public directory causes error #13623

Open
@craigrileyuk

Description

@craigrileyuk

Vue version

3.6.0-alpha.1

Link to minimal reproduction

https://the-sfc-playground-does-not-support-this-yet.com

Steps to reproduce

  1. Run pnpm create vite vapor
  2. Create a standard Vue project
  3. Change Vue version to ^3.6.0-alpha.1
  4. Change App.vue and HelloWorld.vue to <script setup vapor>
  5. Change main.js to createVaporApp(App).mount("#app");

Inside App.vue, the Vue logo which is <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" /> will work fine. However, the Vite logo which is <img src="/vite.svg" class="logo" alt="Vite logo" /> causes the following error:

TypeError: Cannot read properties of undefined (reading 'findIndex')
    at getImportsExpressionExp (/Users/username/Code/Vue3/vapor/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:2152:43)

So it seems that any images from the 'public' directory cause an error.

What is expected?

For 'dev' and 'build' to work

What is actually happening?

An error is thrown when using an image src from the public directory

System Info

System:
    OS: macOS 13.7.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 243.83 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.17.0 - ~/.nvm/versions/node/v22.17.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.17.0/bin/npm
    pnpm: 10.13.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 138.0.7204.101
    Safari: 18.5
  npmPackages:
    vue: ^3.6.0-alpha.1 => 3.6.0-alpha.1

Any additional comments?

No response

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