Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResolverError and .remarkrc file not working on VSCode Windows #29

Open
drtingtp opened this issue Nov 21, 2023 · 4 comments
Open

ResolverError and .remarkrc file not working on VSCode Windows #29

drtingtp opened this issue Nov 21, 2023 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@drtingtp
Copy link

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.

@JulianCataldo
Copy link
Owner

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 JulianCataldo added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Dec 6, 2023
@web-dev-sam
Copy link

web-dev-sam commented Dec 31, 2023

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

@JulianCataldo
Copy link
Owner

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

@web-dev-sam
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants