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

bug: comments not allowed in wrangler.json, change the format to jsonc #71

Open
MathurAditya724 opened this issue Feb 1, 2025 · 3 comments

Comments

@MathurAditya724
Copy link

VSCode provides an error for the comments in the wranger.json, changing it to .jsonc resolves the issue. We have 2 options to resolve this -

  1. Either change the format
  2. Or, remove the comments from the template (I don't like this tho)

I understand that many might not be familiar with the .jsonc format, so I wanted to bring this issue to everyone's attention and get your opinion.

Image

@MathurAditya724 MathurAditya724 changed the title fix: change wrangler.json format to jsonc bug: change wrangler.json format to jsonc Feb 1, 2025
@yusukebe
Copy link
Member

yusukebe commented Feb 1, 2025

Hi @MathurAditya724

Thank you for the issue.

My environment, my VSCode, does not show the error. And, the "Hello World" project that does not use Hono created by Create Cloudflare CLI uses wrangler.json not .jsonc It also does not throw the error.

Image

Is this because my environment is different from yours, or do you need to make some setting?

@MathurAditya724 MathurAditya724 changed the title bug: change wrangler.json format to jsonc bug: comments not allowed in wrangler.json, change the format to jsonc Feb 2, 2025
@MathurAditya724
Copy link
Author

I just checked again, and it turns out that my linter, biome, was giving me the error. Sorry for the false alarm.

I'm just curious if we should remove the comments in .json, as we have defined the schema and are getting the IntelliSense.

@yusukebe
Copy link
Member

yusukebe commented Feb 2, 2025

@MathurAditya724

Thank you for checking it.

I'm just curious if we should remove the comments in .json, as we have defined the schema and are getting the IntelliSense.

I also thought that! The schema showing complement is good. But it will be more helpful to have comments. I want to know the opinions of others.

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

No branches or pull requests

2 participants