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

VSCode shows error at "import.meta.main" #712

Closed
joehillen opened this issue Aug 31, 2022 · 1 comment
Closed

VSCode shows error at "import.meta.main" #712

joehillen opened this issue Aug 31, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@joehillen
Copy link

joehillen commented Aug 31, 2022

Describe the bug

When in vscode and "typescript.tsserver.experimental.enableProjectDiagnostics": true, is set, there is the following errors at import.meta.main:

The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
Property 'main' does not exist on type 'ImportMeta'.

This happens with almost all extensions disabled except for Deno.

To Reproduce

  1. deno init
  2. code .
  3. Add "typescript.tsserver.experimental.enableProjectDiagnostics": true, to User/settings.json
  4. Run "Deno: Initialize Workspace"
  5. Open main.ts

Expected behavior

Don't show an error.

Versions

vscode: 1.70.2 deno: 1.25.0 extension: 3.13.1

Notes

Obviously, the solution is to add "typescript.tsserver.experimental.enableProjectDiagnostics": false, to .vscode/settings.json, but it took me a while to find the culprit. Is there any way the Deno extension can prevent others from having this issue in the future?

@kitsonk kitsonk added the duplicate This issue or pull request already exists label Aug 31, 2022
@kitsonk
Copy link
Contributor

kitsonk commented Aug 31, 2022

Duplicate of #437

@kitsonk kitsonk marked this as a duplicate of #437 Aug 31, 2022
@kitsonk kitsonk closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants