How to make Meteor unignore package.json#imports inside dependencies?

In the course of my agent / server / client design pattern shift I want to remove console.log and go for isomorphic ( where appropriate ) asynchronous sequential Logger from day 0; but for today, I just put in a wrapper, and focus on the portability portion, to at least cover both agent and server for now.

matrix-bot-sdk has a logger already in use in at least one agent being ported ( which makes for a CLI by chat, and real-time interaction with the entire distributed application ) and it wisely and practically uses chalk because digital adulting does demands color in console logs… but… chalk uses package.json#imports like so:

Which is defined here:

And I already pretty much complained about here, but not the package.json#imports approach:

Now rather than having 3 places where I define path aliases I want to be more like chalk when I grow up, and use package.json#imports … BUT, then I see this, which might be on the Vite side ( @jorgenvatle ) and not Meteor proper:

Unable to resolve some modules:

  "#ansi-styles" in
/archive/01E/zero/code/ETC/decentrality/node_modules/chalk/source/index.js
(os.linux.x86_64)
  "#supports-color" in
/archive/01E/zero/code/ETC/decentrality/node_modules/chalk/source/index.js
(os.linux.x86_64)

If you notice problems related to these missing modules, consider running:

  meteor npm install --save #ansi-styles #supports-color

Notice how the suggestion would also not fix it, short of forking chalk and removing # from each and including the packages as dependencies ( which do exist on their own also )


Since I do not want to reference matrix-bot-sdk just to get its logger, I extracted and adapted the logger, but chalk itself is what introduces this package.json#imports issue.

Is there a known convention to get Meteor to respect package.json#imports for super vital things like chalk which one ought not be forced to forego in this life?

It does seem like there is discussion in the neighborhood of this issue in node itself which ought do the import based on the package.json but which Meteor has wrapped and taken charge of in meteor-tool


Going to root around a bit to see if there are tsconfig.json or vite.config.ts or .babelrc settings, but you see my problem now. Although I have plenty of hair still at the front end of “40” I would not pull any out over path aliases, whether for myself, or for downstream dependencies we all know and love. Like chalk!

This looks like Vite to start with, and my exact example is given in the comments:

Will work through the Vite portion then double-check at container build also.

Looks like the official term is subpath imports Modules: Packages | Node.js v23.1.0 Documentation

Seeing chalk brought up a lot and curious now, but this seems Vite specific until I can verify otherwise, so I am tracking here: