unplugin / unplugin-vue2-script-setup

💡 Bring `<script setup>` to Vue 2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import script setup component Module has no default export.

634323580 opened this issue · comments

commented

image

image

+1

commented

+1

Can you provide a minimal reproduction?

commented

nuxt 2 + typescript without using nuxt bridge
buildModules param in nuxt.config.ts is like

  buildModules: [
    "@nuxtjs/stylelint-module",
    "@nuxtjs/tailwindcss",
    "@nuxt/postcss8",
    "@nuxtjs/composition-api/module",
    "@nuxt/typescript-build",
    ["@nuxtjs/dotenv", { path: "./" }],
  ],

And when i import the child component (written in vue setup syntax) in the parent component,
the nuxt builtin fork-ts-checker-webpack-plugin typescript check would throw out an error as below

ERROR in src/pages/chatroom/:id.vue:23:8
TS1192: Module '"/Users/gewb/workspace/my-stream-fe/src/components/chatroom/PrimarySidebar.vue"' has no default export.
    21 | 
    22 | import MainContent from "~/components/chatroom/MainContent.vue";
  > 23 | import PrimarySidebar from "~/components/chatroom/PrimarySidebar.vue";
commented

related issue: #676 #668 of fork-ts-checker-webpack-plugin