unjs / jiti

Runtime Typescript and ESM support for Node.js
MIT License
1.49k stars 52 forks source link

Jiti v1.21.1 breaks Docusaurus #237

Closed slorber closed 1 month ago

slorber commented 1 month ago

Environment

Jiti v1.21.1 does not seem to be retro-compatible with v1.21.0 and breaks Docusaurus usage due to dependency being upgraded

https://github.com/facebook/docusaurus/issues/10199

Reproduction

yarn create docusaurus

It fails on yarn start

But it gets fixed once we resolve to former Jiti version

  "resolutions": {
    "jiti": "1.21.0"
  },

Describe the bug

Not sure exactly what happens here but it looks like Docusaurus does not see anymore the named export callbacks we call by convention on our Docusaurus plugins.

var options_1 = require("./options");
Object.defineProperty(exports, "validateOptions", { enumerable: true, get: function () { return options_1.validateOptions; } });

The validateOptions export should be called by Docusaurus core, but it is not called anymore, so it seems modules loaded by Jiti are slightly different from before.

Additional context

No response

Logs

No response

pi0 commented 1 month ago

Hi dear @slorber. It is a pitty if it is a regressed behavior of babel... I will investigate and keep you updated.

slorber commented 1 month ago

Thanks for investigating. Sorry not to be more helpful, I'm on holiday 😅

Jungzl commented 1 month ago

Also breaks UnoCSS https://github.com/unocss/unocss/issues/3869

pi0 commented 1 month ago

Just released jiti@1.21.2 as hotfix for this issue you can upgrade lockfile for the fix.

Recent improvements in mlly.interopdefault seems caused this. (followup investigation: https://github.com/unjs/jiti/issues/238)

homotechsual commented 1 month ago

Just released jiti@1.21.2 as hotfix for this issue you can upgrade lockfile for the fix.

Recent improvements in mlly.interopdefault seems caused this.

Amazing, thanks so much for the prompt fix and release on this!