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

Build error with a specific template layout #157

Closed
akaufmann opened this issue May 15, 2020 · 1 comment
Closed

Build error with a specific template layout #157

akaufmann opened this issue May 15, 2020 · 1 comment

Comments

@akaufmann
Copy link

Describe the bug

This layout (must be in a folder e.g. /src/pages/Home.vue) throws an error when you run vite build:

/* ./src/pages/Home.vue */
<template>
  <div>
    <div>
      <div class="bar">
        <p class="foo">Lorem ipsum...</p>
        <a href="/">Link</a>
      </div>
      <div class="baz">
        <img src="../../logo.png" /> <!-- the root cause -->
      </div>
    </div>
  </div>
</template>

/* ./src/App.vue */
<template>
  <Home />
</template>

<script lang="ts">
import Home from './pages/Home.vue'

export default {
  components: {
    Home
  }
}
</script>

This is the minimal example I could reproduce the error with. If you remove one of the CSS classes or replace the anchor tag with a div, the build will work.

System Info

  • required vite version: 0.15.3
  • required Operating System: macOS Catalina
  • required Node version: 13.7.0

Logs (Optional if provided reproduction)

$ vite build
vite v0.15.3
⠋ Building for production...
⠙ Building for production...
[vite] Build errored out.
ReferenceError: _imports_0 is not defined
    at eval (eval at evaluateConstant (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2894:16), <anonymous>:1:1)
    at evaluateConstant (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2894:53)
    at stringifyElement (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2837:29)
    at stringifyNode (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2869:20)
    at stringifyElement (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2853:16)
    at stringifyNode (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2869:20)
    at stringifyElement (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2853:16)
    at Object.stringifyStatic [as transformHoist] (/Users/akaufmann/test-vite/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:2750:28)
    at walk (/Users/akaufmann/test-vite/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1236:31)
    at walk (/Users/akaufmann/test-vite/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1266:13) {
  code: 'PLUGIN_ERROR',
  plugin: 'vue',
  hook: 'transform',
  id: '/Users/akaufmann/test-vite/src/pages/Home.vue?vue&type=template&id=2305b5da',
  watchFiles: [
    ...
  ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@akaufmann akaufmann changed the title Build error for a specific template layout Build error with a specific template layout May 15, 2020
yyx990803 added a commit to vuejs/core that referenced this issue May 18, 2020
@yyx990803
Copy link
Member

Closed via vuejs/core@dd2bfb5 (will require new release from vue core)

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

No branches or pull requests

2 participants