Comments (15)
Ah yes, with 3.0 we will be dropping support for Node 12, since it's deprecated π
https://nodejs.org/en/about/releases/
from ms.
Does Repl.it require ESM code? I see an error about about CJS. If so, could you try the latest canary which ships support for ES Modules?
https://github.com/vercel/ms/releases/tag/3.0.0-canary.1
from ms.
Ah yes, with 3.0 we will be dropping support for Node 12, since it's deprecated π
Why?
since it is outdated
It's a terrible decision, since you may well support version 6
from ms.
having the same issue on Repl.it, did you manage to sort it out by any chance?
Update: Looks like I just had to upgrade the version of Node running on Repl.it as the default is v12
from ms.
Iβm using [email protected]
and run into the same issue in CJS code. The exported CJS code of ms
is using optional chanining which is incompatible with Node.js 12. You must at least use Node.js v14 or later.
I guess v3 of this package uses Typescript and should be able to transpile the code being compatible with Node.js v12. I just donβt know enough about the build/transpilation process yet to make a suggestions how the current setup needs to be modified to work with Node.js v12.
from ms.
I digged through the scripts/build.js
file searching the transpilation step causing this issue. Itβs this part:
Lines 23 to 26 in 1304f15
The snippet explicitly referencing ES2020
(Node.js v14).
Using ES2019
resolves to Node.js v12 and would map the engine requirement in the package.json
file.
from ms.
But the non-canary release should still be working with Node 12 (latest stable).
from ms.
@leerob Ok thank you! Node 12 is in maintenance LTS until 2022-04-30. I hoped you would support it in 3.0 as well π
from ms.
Good point - we will chat about that before it becomes stable π
from ms.
Sweet! Thank you!
from ms.
Just to be clear @marcuspoehls, the only major change here is ESM and native types. So you shouldn't need to update, however I understand your point... and as it's probably an easy change, maybe we should add back in Node 12 support until LTS ends.
from ms.
@mrmckeb Hey Brody, the native types are the reason I wanted to update π you have a nice typing setup (with template strings) making things just a bit nicer when using typescript.
I downgraded to [email protected] and created my own typings. Iβll probably upgrade to [email protected] next year when Node.js 12 is EOL. Assuming that you're targeting Node.js v14 with 3.x
from ms.
Use @lukeed/ms instead of this package.
from ms.
I agree with @mrmckeb, might make sense to wait until April to get rid of Node 12. Appreciate the feedback here!
from ms.
I believe we can close this out now. We are planning for the 3.0 stable release, which will include dropping Node 12 support since the LTS has passed. You can track that here: #184
from ms.
Related Issues (20)
- Cannot find module 'ms' or its corresponding type declarations. (3.0.0-canary.0) HOT 4
- Change the language HOT 2
- Release of v3.0.0 HOT 21
- TypeError: (0 , ms_1.default) is not a function HOT 4
- 'esModuleInterop' flag and referencing its default export.ts HOT 3
- fix(typing): Could not find a declaration file for module 'ms'. HOT 2
- No type definitions HOT 1
- The package is just showing the time in days
- Hello
- Typing: ms with `StringValue` should not accept options HOT 1
- Can we have for Dart, should I go ahead and do it?
- TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
- Outdated version on npm
- How to use ms with French HOT 1
- Is the project still being maintained? HOT 3
- Repo link
- Publish stable version with typescript HOT 2
- ms('1y') or ms('1 year') is returning a value slightly off an actual year HOT 2
- Convert the value returned by ms() to a Date
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ms.