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

vue2 build error #118

Open
5 tasks done
cyshigehaohaizi opened this issue Aug 31, 2022 · 2 comments
Open
5 tasks done

vue2 build error #118

cyshigehaohaizi opened this issue Aug 31, 2022 · 2 comments

Comments

@cyshigehaohaizi
Copy link

cyshigehaohaizi commented Aug 31, 2022

Describe the bug

when I build vite3+vue2 project it error , but in development environment it work

error

'default' is not exported by src/apiDoc/test.md?vue&type=script&lang.ts, imported by src/apiDoc/test.md
file: F:/emr/vite-vue2-master/src/apiDoc/test.md:1:7
1: import __vue2_script from "F:/emr/vite-vue2-master/src/apiDoc/test.md?vue&type=script&lang.ts"
          ^
2: export * from "F:/emr/vite-vue2-master/src/apiDoc/test.md?vue&type=script&lang.ts"
3: import { render as __vue2_render, staticRenderFns as __vue2_staticRenderFns } from "F:/emr/vite-vue2-mast
er/src/apiDoc/test.md?vue&type=template&lang.js"
error during build:
Error: 'default' is not exported by src/apiDoc/test.md?vue&type=script&lang.ts, imported by src/apiDoc/test.
md

this is my config

import { createVuePlugin } from 'vite-plugin-vue2'
import Markdown from 'vite-plugin-md'
export default {
  plugins: [
    createVuePlugin({
       include: [/\.vue$/, /\.md$/],
    }),
    Markdown(),
  ],
}

use

<template>
  <div>
    {{message}}
    <test></test>
  </div>
</template>

<script>
  import test from './apiDoc/test.md'
  export default {
    data() {
      return {
        message: 'Hello world22!'
      }
    },
    components:{
      test
    }
  }
</script>

Reproduction

vite vue2 build

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 5.98 GB / 15.89 GB
  Binaries:
    Node: 16.10.0 - D:\nodejs\node.EXE
    Yarn: 1.12.3 - D:\yarn\bin\yarn.CMD
    npm: 7.24.0 - D:\nodejs\npm.CMD
  Browsers:
    Chrome: 105.0.5195.53
    Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.70)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@palapl
Copy link

palapl commented Sep 8, 2022

@cyshigehaohaizi I met same problem with you.
It successed when I add vueVersion.
like this:
Markdown({ vueVersion: '2.x.x' }) // your Vue version

@yankeeinlondon
Copy link
Sponsor Collaborator

yankeeinlondon commented Dec 15, 2022

@cyshigehaohaizi can you try Release v0.22.0 and see if it fixes your error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants