catamphetamine / javascript-time-ago

International highly customizable relative date/time formatting

Home Page:https://catamphetamine.gitlab.io/react-time-ago/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to compile with the new version of 2.2.1

shoonia opened this issue · comments

I updated the library from 2.1.5 to 2.2.1 and my build is failed with error:

Production build...
Failed to compile.

./node_modules/javascript-time-ago/modules/steps/index.js 7:0-8:54
"export 'getStepForUnit' (reexported as 'getStep') was not found in './helpers'

./node_modules/javascript-time-ago/modules/steps/index.js 7:0-8:54
Attempted import error: 'getStepForUnit' is not exported from './helpers'.

I use:

"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"babel-loader": "^8.1.0",
"babel-plugin-const-enum": "^1.0.1",
"typescript": "^4.0.3",
"webpack": "^4.44.2",
"webpack-dev-server": "^3.11.0",

The hotfix for me it's an import from commonjs folder

// successful build
import TimeAgo from 'javascript-time-ago/commonjs/TimeAgo';

published javascript-time-ago@2.2.2

Я там немного поменял всякого-разного. По идее, старый код не будет ломаться (думаю, люди не использовали функцию getStep(), которая была убрана).

Wow. Thanks! It's amazing!

Спасибо за либу! очень оперативно )