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

Just not working #1

Open
spetrac opened this issue Jul 23, 2024 · 1 comment · May be fixed by #2
Open

Just not working #1

spetrac opened this issue Jul 23, 2024 · 1 comment · May be fixed by #2

Comments

@spetrac
Copy link

spetrac commented Jul 23, 2024

This is an amazing project and I could use this really badly.

The problem is, it is just not working. I checked everything: used the workspace version of TS in vscode, added the plugin declaration accordingly to tsconfig.json and even tried to inspect the tsserver.log but found nothing unusual. The plugin seemed to have just started fine but I still get the "Cannot find module './example.yaml' or its corresponding type declarations." message.

I want this plugin because I tried to get yaml support for typescript imports in a nextjs project. After many considerations a used yaml-loader to load the files and it works fine with the webpack config. I understand that a working bundler has nothing to do with the typescript interpreter and I found a link to this repo in eemeli/yaml-loader#29. It would be absolutely fantastic, if this package could even support the same config as the loader or come with the loader altogether, but that is not the current issue.

The only difference in my case is a new typescript version. Currently I am using 5.5.3. Is there any chance that this could be fixed? I noticed that there are hardly any projects that solve the issue of importing yaml into typescript and I really want this functionality :)

rickdgeerling added a commit to rickdgeerling/typescript-plugin-yaml that referenced this issue Aug 22, 2024
There was a breaking change in the plugin interface. Code is refactored
to support both v4 and v5. I've only tested v5.5.3 here, but the
refactor is heavily borrowed from https://github.com/mrmckeb/typescript-plugin-css-modules

Closes await-ovo#1
@rickdgeerling rickdgeerling linked a pull request Aug 22, 2024 that will close this issue
@rickdgeerling
Copy link

rickdgeerling commented Aug 22, 2024

Opened a PR that "works on my machine" (tm). Feel free to give it a try #2

Edit: I've pushed a compiled version to a tag, so you can try it in your package.json using "typescript-plugin-yaml": "tuxmachine/typescript-plugin-yaml#v0.1.0-beta". Be aware that it's an LSP plugin that provides types in the IDE. TSC doesn't support plugins at compile-time, you'll need a bundler for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants