最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - Issue with Installing and Using react-timeago in Vite + React - Stack Overflow

programmeradmin3浏览0评论

I encountered issues when installing and using react-timeago in my Vite + React project.

Installation Command Used:

npm install react-timeago@latest

Warnings During Installation:

npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: This package is no longer supported.

Error in Vite When Importing react-timeago:

[plugin:vite:import-analysis] Missing "./lib/language-strings/fr" specifier in "react-timeago" package
C:/xampp/htdocs/my_code/src/components/Dropdown.jsx:7:26
23 |  import frenchStrings from "react-timeago/lib/language-strings/fr";

Code Causing the Issue:

import ReactTimeAgo from 'react-timeago';
import frenchStrings from 'react-timeago/lib/language-strings/fr';
import buildFormatter from 'react-timeago/lib/formatters/buildFormatter';

const formatter = buildFormatter(frenchStrings);
发布评论

评论列表(0)

  1. 暂无评论