使用uuid报错:Deep requiring like `const uuidv1 = require('uuid/v1');` is deprecated as of uuid@7.x. Please require the top-level module when using the Node.js CommonJS module or use ECMAScript Modules when bundling for the browser.
将import uuidv1 from 'uuid/v1'改为import { v1 as uuidv1 } from 'uuid'即可
本文解决使用UUID v1版本时出现的深依赖错误,介绍了如何更新导入语句以适应UUID@7.x版本,避免了在Node.js和浏览器环境下使用过时的导入方式。
1万+

被折叠的 条评论
为什么被折叠?



