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

resolvers for naive-ui not working with version 0.27.* #784

Open
5 tasks done
Lucas0819 opened this issue Jul 25, 2024 · 4 comments
Open
5 tasks done

resolvers for naive-ui not working with version 0.27.* #784

Lucas0819 opened this issue Jul 25, 2024 · 4 comments

Comments

@Lucas0819
Copy link

Describe the bug

I have tried with version 0.27.0 - 0.27.3, and all of them doesn't work at all

// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [NaiveUiResolver()],
    }),
  ],
})

// main.js
import { createApp } from 'vue'
import App from './App.vue'

const app = createApp(App)
app.mount('#app')
<!-- App.vue -->
<template>
  <NConfigProvider />
</template>

Error message:

chunk-H2P5RRWN.js?v=2fdc74b2:1558 [Vue warn]: Failed to resolve component: NConfigProvider If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at App

Dependencies version:

"vue": "3.4.31",
"vite": "5.3.4",
"@vitejs/plugin-vue": "5.1.0",

Reproduction

http://localhost:5173/

System Info

System:
    OS: macOS 14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 304.89 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.4 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 10.7.0 - /usr/local/bin/npm
    pnpm: 9.6.0 - /usr/local/bin/pnpm
    Watchman: 2024.04.08.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 126.0.6478.185

Used Package Manager

npm

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.
@xiaoyang5116
Copy link

image image Do not change the include order

@caser993
Copy link

caser993 commented Aug 7, 2024

I also encountered a similar problem. My local development and use were normal. After Vite was built, all introduced styles were lost, causing page exceptions.
I tried to reproduce the minimal implementation of this defect, but it could not be reproduced after just introducing navie-ui to build it. It is speculated that it is caused by using other frameworks at the same time. The code snippet for uploading the problem needs to be determined.
currently locked to v0.26.0 to ensure normal online functions. I will continue to pay attention to this issue

@jtmiclat
Copy link

jtmiclat commented Oct 14, 2024

Hi! We had similar issue as well for versions v0.27.0. But was able to resolve by upgrading to v0.27.4. I think it might be tied to #767 which was addressed in v0.27.4 via #768

@hellorayza
Copy link

I have a similar problem, but it occurred in .tsx. After changed to .vue it worked.

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

5 participants