8000 lume upgrade --dev fails to parse deno.json · Issue #746 · lumeland/lume · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lume upgrade --dev fails to parse deno.json #746

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

Open
iacore opened this issue Apr 22, 2025 · 1 comment
Open

lume upgrade --dev fails to parse deno.json #746

iacore opened this issue Apr 22, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@iacore
Copy link
Contributor
iacore commented Apr 22, 2025

Version

/

Platform

/

What steps will reproduce the bug?

Add an extra comma in deno.json, then run deno task lume upgrade --dev.

How often does it reproduce? Is there a required condition?

100%

What is the expected behavior?

It should work.

What do you see instead?

Task lume echo "import 'lume/cli.ts'" | deno run -A - "upgrade" "--dev"
SyntaxError: Expected double-quoted property name in JSON at position 211 (line 9 column 3)
    at JSON.parse (<anonymous>)
    at https://deno.land/x/lume_init@v0.3.3/steps/load.ts:10:27
    at eventLoopTick (ext:core/01_core.js:178:7)
    at async Init.run (https://deno.land/x/lume_init@v0.3.3/init.ts:115:22)
    at async default (https://deno.land/x/lume@v2.5.3/cli/upgrade.ts:5:3)
    at async Command.fn (https://deno.land/x/lume@v2.5.3/cli.ts:18:5)
    at async Command.execute (https://deno.land/x/cliffy@v0.25.7/command/command.ts:1794:7)
    at async Command.parseCommand (https://deno.land/x/cliffy@v0.25.7/command/command.ts:1639:14)
    at async https://deno.land/x/lume@v2.5.3/cli.ts:175:3

Additional information

I believe Deno uses json5 for its config, not JSON.parse.

Maybe elsewhere in Lume has this bug too.

@iacore iacore added the bug Something isn't working label Apr 22, 2025
@oscarotero
Copy link
Member

Deno allows jsonc (json with comments), but not json5 (that is a different format).

Lume can read deno.json and deno.jsonc. I guess you're using jsonc format with the json extension, right?
The load function only use jsonc if the file extension is .jsonc (source) Maybe it should be changed to use it for all formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
0