ant-design-vue-nuxt icon indicating copy to clipboard operation
ant-design-vue-nuxt copied to clipboard

Ant Design doesn't work with Nuxt Layers

Open avxkim opened this issue 1 year ago • 7 comments

ui-kit.zip reproducible code attached to this issue, i was using pnpm (but it doesn't matter, if it's pnpm or npm / yarn)

Steps to reproduce:

  1. pnpm install
  2. pnpm dev it gets stuck

avxkim avatar Mar 07 '24 07:03 avxkim

Same problem, and it took over two minutes to warm up on my Windows!

image

Eventually, the page fails to render.

Sun-ZhenXing avatar Mar 09 '24 03:03 Sun-ZhenXing

Additional Notes:

The final page rendered, but some warnings appeared before that. After about five minutes.

[Vue warn]: Failed to resolve component: a-extract-style
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Failed to resolve component: a-extract-style
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Failed to resolve component: a-extract-style
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Failed to resolve component: a-extract-style
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.
[Vue warn]: Component <Anonymous> is missing template or render function.

Does this seem to be a result of Vite optimizing ES Modules?

I think this is a serious performance issue. I will try to provide a reproduction to help fix this if necessary.

Sun-ZhenXing avatar Mar 09 '24 04:03 Sun-ZhenXing

@Sun-ZhenXing have you tried to use this module in a module instead?

avxkim avatar Mar 13 '24 09:03 avxkim

@Sun-ZhenXing have you tried to use this module in a module instead?

No, I don't know how to make such an attempt.

Sun-ZhenXing avatar Mar 13 '24 10:03 Sun-ZhenXing

@avxkim, please check this minimal reproduction, it works fine but takes about 5 minutes to render on my Windows 11 (Intel 12900).

Try:

pnpm i
pnpm dev

Sun-ZhenXing avatar Mar 15 '24 06:03 Sun-ZhenXing

It seems to have been working since Nuxt 3.12.4. I checked it with different Nuxt versions: 3.10.3 to 3.12.3: It takes about 2 minutes on my laptop to warm up the dev server 3.12.4 and 3.13.0: It takes a few seconds to warm up the server

andreev-nikita avatar Aug 27 '24 09:08 andreev-nikita

@andreev-nikita Nuxt 3.13 has refactored many of the layers implementations, and this is no longer an issue.

Sun-ZhenXing avatar Aug 27 '24 10:08 Sun-ZhenXing