remark-lint-frontmatter-schema icon indicating copy to clipboard operation
remark-lint-frontmatter-schema copied to clipboard

ResolverError and .remarkrc file not working on VSCode Windows

Open drtingtp opened this issue 1 year ago • 4 comments

I believe I have encountered a path resolving issue with remark-lint-frontmatter-schema on VSCode Windows (v1.84.2).

I am using a VSCode test profile with only vscode-remark extension (v2.1.0) installed.

Here's how the bug is produced:

  1. Clone the demo repo.
  2. Follow the installation step pnpm install remark ...
  3. Follow the installation step code --install-extension ...
  4. Follow the instruction and create the root config ./.remarkrc.mjs
  5. Explore and tinker with the content folder md files to observe the bug behaviour:

behind-the-gare-st-lazare__local-broken.md file gives an error

YAML schema file load/parse: content\creative-work.schema.yaml — ResolverError: Error opening file "D:\test remark\node_modules\.pnpm\@[email protected]\node_modules\@apidevtools\json-schema-ref-parser\dist\content\creative-work.schema.yaml" ENOENT: no such file or directory, open 'D:\test remark\node_modules\.pnpm\@[email protected]\node_modules\@apidevtools\json-schema-ref-parser\dist\content\creative-work.schema.yaml'

however, if the '$schema' parameter is set to ./content/creative-work.schema.yaml, the linting works

image

The the-shipwreck__global-broken.md file does not report any linting error when opened. When '$schema': ./content/creative-work.schema.yaml is pasted, the linting problems show up.

image image

There is no mentioning of whether the .remarkrc.mjs file was loaded correctly - there was no error message, but when I supply a wrong schema path or target path, it still does not produce any error message.

This is my pnpm-lock file, hope it helps figuring out what went wrong.

drtingtp avatar Nov 21 '23 11:11 drtingtp

Great report, thank you for all those details. Unfortunately, I don't use non POSIX-compliant OSes anymore, even though I tried to use Win-friendly path resolving mechanisms inside this package, like minimatch, find-up… E.g. we had previous issues with the infamous \ problem (#12). This package used to use rawer mechanisms ;)

I'll try to reproduce this ASAP and I'll get back to you when I got any more insights.

JulianCataldo avatar Dec 06 '23 12:12 JulianCataldo

I just ran into the same problem while using a docker alpine environment with the extension ms-vscode-remote.remote-containers.

web-dev-sam avatar Dec 31 '23 15:12 web-dev-sam

PR is welcome from Windows users, on this bug 🫶🏻. For me, fixing bugs can be insightful and rewarding, but using this OS… is not 🫠.

JulianCataldo avatar Dec 31 '23 15:12 JulianCataldo

Absolutely understandable, though I will write a custom extension for my use case as I need general good frontmatter support with autocomplete and documentation. You can take these ideas as inspiration, it would be pretty cool if your plugin supported more editor features (if that's possible/sensical in this repo).

web-dev-sam avatar Dec 31 '23 18:12 web-dev-sam