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

No loader is configured for ".vue" #26

Open
7 tasks done
jaune001 opened this issue Dec 2, 2021 · 2 comments
Open
7 tasks done

No loader is configured for ".vue" #26

jaune001 opened this issue Dec 2, 2021 · 2 comments

Comments

@jaune001
Copy link

jaune001 commented Dec 2, 2021

Describe the bug

after the import component library, prompt error,

error message:
image

@xx/up-ui is independent research and development components

    {
  "name": "vite-vue2",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vite",
    "build": "vite build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "@xx/up-ui": "^2.1.81",
    "core-js": "^3.6.5",
    "path": "^0.12.7",
    "vite": "^2.3.7",
    "vite-plugin-vue2": "^1.6.2",
    "vue": "^2.6.11",
    "vue-router": "^3.2.0",
    "vuex": "^3.4.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/eslint-config-prettier": "^6.0.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-vue": "^6.2.2",
    "less": "^3.0.4",
    "less-loader": "^5.0.0",
    "prettier": "^2.2.1",
    "vue-template-compiler": "^2.6.11"
  }
}

Reproduction

https://github.com/WongYuYe/vite-vue2-demo

vite-vue2-demo import @xx/up-ui components

@xx/up-ui is research and development of internal component library

@xx/up-ui vue: 2.xx

System Info

MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)

node: v14.17.5
npm: 6.14.14

Used Package Manager

npm

Logs

npm run serve

Validations

@Shinigami92
Copy link
Member

I assume this is not a problem of vite itself but you try to use a combination of vue-cli and vite together 🤔

@bluwy
Copy link
Member

bluwy commented Mar 21, 2022

This is because vue-pdf exports the raw Vue file, which esbuild can't handle unless there's a esbuild plugin that handles Vue files. Until plugin-vue supports something like vitejs/vite#6801 (experimental), vue-pdf should be publishing compiled JS files. Another workaround is to optimizeDeps.exclude: ["vue-pdf"] so that the Vue files are processed by the Vite dev server. Its transitive deps may need to be re-included (docs).

Related: FranckFreiburger/vue-pdf#304

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

No branches or pull requests

3 participants