You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Ava and Node.js to run unit tests, and postprocessing is in the dependencies of the tested code. When running the tests, Node.js hits this error:
SyntaxError: The requested module 'postprocessing' does not provide an export named 'Effect'
Of course postprocessing does export Effect, in fact. I think this comes down to nodejs/node#32137. Node.js expects that ES Modules will either (a) use "type": "module" or (b) use .mjs, if I understand this correctly. Because postprocessing currently does neither, it cannot resolve the import.
This isn't urgent for me, but I just wanted to flag the issue. I see Remove CJS bundles, change type to module on the roadmap; that would certainly solve the issue as far as I'm concerned. I believe it would be a non-breaking change to add "type": "module" now, as long as you keep the main entry and change its extension to .cjs. Example:
Sorry, I don't think I follow the connection with those threads — the example config from ktx-parse is what I'm proposing, and hoping might not be a breaking change. I'm not proposing that postprocessing use .mjs files. I don't mind waiting for v7 either, though. Thanks!
Those threads were problems that occured after I tried changing the package type to module or the extension of the bundle to .mjs. I don't remember the exact configs I tried, but it all turned out to be a breaking change in some way or another. Maybe the configuration you propose is actually non-breaking, but I'd rather make the change in v7.
Makes sense, thanks! The whole cjs / mjs situation is really something. I'm glad to see more packages moving to ESM-first. Let me know if I can help here, or feel free to close the issue if this is already covered by the roadmap.
Uh oh!
There was an error while loading. Please reload this page.
I'm using Ava and Node.js to run unit tests, and
postprocessing
is in the dependencies of the tested code. When running the tests, Node.js hits this error:Of course postprocessing does export
Effect
, in fact. I think this comes down to nodejs/node#32137. Node.js expects that ES Modules will either (a) use"type": "module"
or (b) use.mjs
, if I understand this correctly. Because postprocessing currently does neither, it cannot resolve the import.This isn't urgent for me, but I just wanted to flag the issue. I see
Remove CJS bundles, change type to module
on the roadmap; that would certainly solve the issue as far as I'm concerned. I believe it would be a non-breaking change to add"type": "module"
now, as long as you keep themain
entry and change its extension to.cjs
. Example:https://github.com/donmccurdy/KTX-Parse/blob/d7e7fefbef44642d5dbb9444a64bc055d4483ce8/package.json#L5-L14
The text was updated successfully, but these errors were encountered: