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

在nuxt中构建包后有vueuc导入方式问题报错,导致页面访问500 #6682

Open
5 tasks done
PrettyPuppyCavalier opened this issue Jan 4, 2025 · 6 comments
Open
5 tasks done
Labels
untriaged need to sort

Comments

@PrettyPuppyCavalier
Copy link

描述错误

[nuxt] [request error] [unhandled] [500] Named export 'VBinder' not found. The requested module 'vueuc' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'vueuc';
const { resizeObserverManager, VResizeObserver, VirtualList, VFollower, VBinder, VTarget, VOverflow, VFocusTrap } = pkg;

复现步骤

  1. 构建nuxt应用
  2. 安装npm install naive-ui
  3. 打包npm run build
  4. 预览npm run preview

最小复现链接

none

系统信息

node版本 v20.11.1
nuxt版本 3.15.0
navie UI版本 2.40.4

使用的包管理器

npm

验证

@PrettyPuppyCavalier PrettyPuppyCavalier added the untriaged need to sort label Jan 4, 2025
@f754699
Copy link

f754699 commented Jan 10, 2025

我也是这个问题

@f754699
Copy link

f754699 commented Jan 12, 2025

我解决了

// nuxt.config.js build: { transpile: ['naive-ui', "vueuc"], },

@PrettyPuppyCavalier
Copy link
Author

PrettyPuppyCavalier commented Jan 13, 2025 via email

@f754699
Copy link

f754699 commented Jan 13, 2025

那你不早说,

@nigiwen
Copy link

nigiwen commented Jan 25, 2025

不行哇还是报错

@isTrih
Copy link

isTrih commented Jan 27, 2025

不行哇还是报错

你更新nuxt3.15.3了?我通过回退3.15.0解决500了

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

No branches or pull requests

4 participants