New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My code will not run after importing ms #167
Comments
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 |
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? |
I’m using 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. |
I digged through the Lines 23 to 26 in 1304f15
The snippet explicitly referencing Using |
Ah yes, with 3.0 we will be dropping support for Node 12, since it's deprecated 👍 |
But the non-canary release should still be working with Node 12 (latest stable). |
@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 😃 |
Good point - we will chat about that before it becomes stable 😄 |
Sweet! Thank you! |
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. |
@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 ms@2.x and created my own typings. I’ll probably upgrade to ms@3.x next year when Node.js 12 is EOL. Assuming that you're targeting Node.js v14 with 3.x |
Why?
It's a terrible decision, since you may well support version 6 |
Use @lukeed/ms instead of this package. |
I agree with @mrmckeb, might make sense to wait until April to get rid of Node 12. Appreciate the feedback here! |
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 |
Since installing ms with npm, I get the following error:
node main.js
/home/runner/RamenBot/node_modules/ms/dist/index.cjs:16
return options?.long ? fmtLong(value) : fmtShort(value);
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/runner/RamenBot/commands/mute.js:1:12)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
exit status 1
(This is on repl.it btw, for some reason it works on vsc but not repl.it, it also won't run on heroku either)
The text was updated successfully, but these errors were encountered: