Giter VIP home page Giter VIP logo

Comments (15)

leerob avatar leerob commented on June 9, 2024 4

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.

leerob avatar leerob commented on June 9, 2024 1

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.

polRk avatar polRk commented on June 9, 2024 1

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.

Sikksens avatar Sikksens commented on June 9, 2024

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.

marcuspoehls avatar marcuspoehls commented on June 9, 2024

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.

marcuspoehls avatar marcuspoehls commented on June 9, 2024

I digged through the scripts/build.js file searching the transpilation step causing this issue. It’s this part:

ms/scripts/build.js

Lines 23 to 26 in 1304f15

compile([sourceFile], {
module: ts.ModuleKind.ES2020,
declaration: true,
});

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.

leerob avatar leerob commented on June 9, 2024

But the non-canary release should still be working with Node 12 (latest stable).

from ms.

marcuspoehls avatar marcuspoehls commented on June 9, 2024

@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.

leerob avatar leerob commented on June 9, 2024

Good point - we will chat about that before it becomes stable πŸ˜„

from ms.

marcuspoehls avatar marcuspoehls commented on June 9, 2024

Sweet! Thank you!

from ms.

mrmckeb avatar mrmckeb commented on June 9, 2024

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.

marcuspoehls avatar marcuspoehls commented on June 9, 2024

@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.

Uzlopak avatar Uzlopak commented on June 9, 2024

Use @lukeed/ms instead of this package.

from ms.

leerob avatar leerob commented on June 9, 2024

I agree with @mrmckeb, might make sense to wait until April to get rid of Node 12. Appreciate the feedback here!

from ms.

leerob avatar leerob commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.