Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The value of compiler is differenet with vue playground #427

Closed
8 of 9 tasks
s3xysteak opened this issue Jul 15, 2024 · 1 comment
Closed
8 of 9 tasks

The value of compiler is differenet with vue playground #427

s3xysteak opened this issue Jul 15, 2024 · 1 comment

Comments

@s3xysteak
Copy link

Related plugins

Describe the bug

vite playground
vue playground

Code is :

<template>
  <img src="assets:~/logo.svg" one="1" >
</template>

In vite playground, the value of compiler is:

// ...
import _imports_0 from '/logo.svg'


const _hoisted_1 = {
  src: _imports_0,
  one: "1"
}

function _sfc_render(_ctx, _cache) {
  return (_openBlock(), _createElementBlock("img", _hoisted_1))
}
// ...

With same code in vue playground, the value is:

// ...
const _hoisted_1 = {
  src: "assets:~/logo.svg",
  one: "1"
}
function render(_ctx, _cache) {
  return (_openBlock(), _createElementBlock("img", _hoisted_1))
}

Reproduction

https://stackblitz.com/edit/vitejs-vite-fvy9gv?file=src%2FApp.vue

Steps to reproduce

Run and see the console and error reported, it will show the code different with what in vue playground.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i3-10100 CPU @ 3.60GHz
    Memory: 5.62 GB / 15.90 GB
  Binaries:
    Node: 20.10.0 - ~\AppData\Local\fnm_multishells\17064_1721032557973\node.EXE
    npm: 10.2.3 - ~\AppData\Local\fnm_multishells\17064_1721032557973\npm.CMD
    pnpm: 9.4.0 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.102)
    Internet Explorer: 11.0.19041.4355

Used Package Manager

pnpm

Logs

No response

Validations

@s3xysteak s3xysteak changed the title The value of compile is differenet with vue playground The value of compiler is differenet with vue playground Jul 15, 2024
@s3xysteak
Copy link
Author

It is because the plugin try to handle the asserts in template.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant