-
Notifications
You must be signed in to change notification settings - Fork 43
Extensionless files should allow --input-type (or work) #578
Comments
Ooops, repo not active. Moving. |
Yes, this is impossible, intentionally. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Where is a good way to provide feedback that you don't listen to users and assert your correctness overtop of other people, and make them feel bad for expressing struggles they face? I did find many other threads, but I've still found nothing actually describing or justifying this particular decision about (And for reference (but without linking), node #49295 has more ongoing discussion of this issue) |
Hey @pinko-fowle, there's a genuine misunderstanding happening here. I genuinely believe that @ljharb wasn't trying to put salt in your wounds but to answer your initial issue that this issue you're facing is intentional by design. He probably didn't add more details because none were asked. Your comment also might imply that you're asserting your points over Jordan's, nullifying your point... Or at least that's how I would interpret the comment; my apologies if I did misinterpret it! I'm sorry you've felt that @ljharb answer was not what you'd expect, regardless of that the "in your brand" comment is kinda of unnecessary. Let's keep this conversation healthy :) |
You are welcome to provide personal feedback in private; I'm eminently reachable on most mediums. Providing it in public is rarely productive, for anyone. |
@pinko-fowle please listen to hints around respecting the CoC but when you read these answers just move to bun and call it a day, as this argument has been around for years but Node.js is strongly convinced CJS should stay forever (as non-standard default too). This, as example, is an extensionless bun file you can run without issues and call it whatever you like: #!/usr/bin/env bun
import { readFile } from 'fs';
console.log(readFile); In short, the problem is solved elsewhere and many hope one day node will just work with the ECMAScript standard its built on, but that's not happening any time soon, as answers can tell you. |
While you're certainly free to use bun or anything else, this is an arena that ecma262 simply doesn't cover, also intentionally, so there's no "obvious" approach and certainly no standard one of any kind. |
the same arena where ESM is the only module option available, right? |
Hey y'all, can we please stay on-topic? |
@ovflowd what's not on topic when ecma262 is mentioned as the blocker while ecma262 only knows ESM ? but surely I'm out this thread 👋 |
I locked this thread as there are other threads where this conversation can happen and this one is closed and more heated than I'd like to see. |
Currently it seems impossible to have an extensionless esm file. I get errors like the following:
In general this has been a super frustrating transition. It seems like it would make all the sense in the world to just be able to tell node what the script is. So I tried passing
--input-type module
, thinking, surely, if I tell you, you must be ok with this, yes?Unfortunately this also doesn't work. I get:
I'd love to be able to get extensionless esm modules working. The current advice to add an extension, or define an npm script are both really ugly alternatives that keep Node.js ESM scripts from being able to fit in & look clean like anything else on the system. Adding
--input-type
support seems like an obvious & sensible fix. But any option at all would be fine, to get esm scripts working like anything else on a system would.The text was updated successfully, but these errors were encountered: