whyframe icon indicating copy to clipboard operation
whyframe copied to clipboard

Plugins fail on Windows

Open qinyouzhi opened this issue 2 years ago • 5 comments

Inconsistent path addresses between Mac and Windows (Mac:/ Windows: ), resulting in plugin failure on Windows

qinyouzhi avatar Aug 30 '23 10:08 qinyouzhi

Inconsistent path addresses between Mac and Windows (Mac:/ Windows: \), resulting in plugin failure on Windows

qinyouzhi avatar Aug 30 '23 10:08 qinyouzhi

I don't have a windows machine to test out, and the issue description is vague. Can you further elaborate the issue you're seeing?

bluwy avatar Sep 01 '23 05:09 bluwy

In @whyframe/jsx/src/docusaurus.cjs, the matching rule for rule @docusaurus/mdx-loader in Windows is actually @docusaurus\mdx-loader, which causes the loader to fail to mount

qinyouzhi avatar Sep 01 '23 07:09 qinyouzhi

There is also an issue with the 'this. resource' in loader.cjs. Change it to path.relative(__dirname, this.resource).split(path.sep).join('/') and run it

qinyouzhi avatar Sep 01 '23 07:09 qinyouzhi

Sorry for the late reply, thanks for digging into this!

  1. The changes for @docusaurus/mdx-loader sounds good to me.
  2. For this.resource, maybe it's better to use this.resourcePath instead? Would be great if you can test if this works.

Feel free to send a PR for the two changes too. Don't think we need tests for those for now, I should update CI to also run them in Windows.

bluwy avatar Sep 04 '23 02:09 bluwy