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

Invalid deno.json breaks imports #867

Closed
Tracked by #879
joeldomke opened this issue Jun 15, 2023 · 0 comments · Fixed by denoland/deno#19894
Closed
Tracked by #879

Invalid deno.json breaks imports #867

joeldomke opened this issue Jun 15, 2023 · 0 comments · Fixed by denoland/deno#19894
Assignees
Labels
bug Something isn't working high priority

Comments

@joeldomke
Copy link

Describe the bug
When saving invalid JSON to deno.json, an error message is shown (Unable to parse config file JSON...) by VSCode and imports specified in deno.json will no longer work. After saving a valid config the imports remain broken and will show the following error message: Relative import path "supabase-js" not prefixed with / or ./ or ../

I had to restart the language server to get it working again.

To Reproduce

  1. Add an import to deno.json
{
    "imports": {
        "supabase-js": "https://esm.sh/@supabase/[email protected]"
    }
}
  1. Use the import somewhere
import { createClient} from 'supabase-js'
  1. Break the deno config by including invalid JSON
  2. Save the file
  3. Restore the deno config to the previous state
  4. Save the file
  5. The import in step 2 will no longer work

Expected behavior

After saving a valid config the imports should be recognized without having to restart the language server.

Versions

vscode: 1.74.1 deno: 1.34.2 extension: 3.19.1

@bartlomieju bartlomieju added bug Something isn't working high priority labels Jul 10, 2023
@bartlomieju bartlomieju mentioned this issue Jul 11, 2023
17 tasks
@dsherret dsherret self-assigned this Jul 19, 2023
dsherret added a commit to denoland/deno that referenced this issue Jul 20, 2023
We weren't auto-discovering the deno.json in two cases:

1. A project that didn't have a deno.json and just added one.
2. After a syntax error in the deno.json.

This now rediscovers it in both these cases.

Closes denoland/vscode_deno#867
mmastrac pushed a commit to denoland/deno that referenced this issue Jul 26, 2023
We weren't auto-discovering the deno.json in two cases:

1. A project that didn't have a deno.json and just added one.
2. After a syntax error in the deno.json.

This now rediscovers it in both these cases.

Closes denoland/vscode_deno#867
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants