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

deno lsp: WebWorker will not be treated as Module #9694

Closed
starkpsmichael opened this issue Mar 5, 2021 · 3 comments
Closed

deno lsp: WebWorker will not be treated as Module #9694

starkpsmichael opened this issue Mar 5, 2021 · 3 comments
Labels
bug Something isn't working correctly lsp related to the language server

Comments

@starkpsmichael
Copy link

starkpsmichael commented Mar 5, 2021

Thought this was already fixed in #8914?

Using latest deno canary and actual vscode-deno.

Adding a export {} to the file helps.

Actual Result

Starting Deno language server...
  version: 1.8.0+04740af (release, x86_64-unknown-linux-gnu)
Connected to "Visual Studio Code" 1.53.1
language server initialized
Server ready.
ERROR TSLS = Error: Debug Failure. False expression: Containing file should be a module.
    at checkImportMetaProperty (deno:cli/tsc/00_typescript.js:70604:22)
    at checkMetaProperty (deno:cli/tsc/00_typescript.js:70579:24)
    at checkExpressionWorker (deno:cli/tsc/00_typescript.js:72940:28)
    at checkExpression (deno:cli/tsc/00_typescript.js:72831:38)
    at checkNonNullExpression (deno:cli/tsc/00_typescript.js:67851:37)
    at checkPropertyAccessExpression (deno:cli/tsc/00_typescript.js:67896:85)
    at checkExpressionWorker (deno:cli/tsc/00_typescript.js:72911:28)
    at checkExpression (deno:cli/tsc/00_typescript.js:72831:38)
    at checkExpressionWithContextualType (deno:cli/tsc/00_typescript.js:72478:28)
    at getSignatureApplicabilityError (deno:cli/tsc/00_typescript.js:69000:35)
ERROR TSLS = Error: Debug Failure. False expression: Containing file should be a module.
    at checkImportMetaProperty (deno:cli/tsc/00_typescript.js:70604:22)
    at checkMetaProperty (deno:cli/tsc/00_typescript.js:70579:24)
    at checkExpressionWorker (deno:cli/tsc/00_typescript.js:72940:28)
    at checkExpression (deno:cli/tsc/00_typescript.js:72831:38)
    at checkNonNullExpression (deno:cli/tsc/00_typescript.js:67851:37)
    at checkPropertyAccessExpression (deno:cli/tsc/00_typescript.js:67896:85)
    at checkExpressionWorker (deno:cli/tsc/00_typescript.js:72911:28)
    at checkExpression (deno:cli/tsc/00_typescript.js:72831:38)
    at checkExpressionWithContextualType (deno:cli/tsc/00_typescript.js:72478:28)
    at getSignatureApplicabilityError (deno:cli/tsc/00_typescript.js:69000:35)
ERROR TSLS = Error: Debug Failure. False expression: Containing file should be a module.
    at checkImportMetaProperty (deno:cli/tsc/00_typescript.js:70604:22)
    at checkMetaProperty (deno:cli/tsc/00_typescript.js:70579:24)
    at checkExpressionWorker (deno:cli/tsc/00_typescript.js:72940:28)
    at checkExpression (deno:cli/tsc/00_typescript.js:72831:38)
    at checkNonNullExpression (deno:cli/tsc/00_typescript.js:67851:37)
    at checkPropertyAccessExpression (deno:cli/tsc/00_typescript.js:67896:85)
    at checkExpressionWorker (deno:cli/tsc/00_typescript.js:72911:28)
    at checkExpression (deno:cli/tsc/00_typescript.js:72831:38)
    at checkExpressionWithContextualType (deno:cli/tsc/00_typescript.js:72478:28)
    at getSignatureApplicabilityError (deno:cli/tsc/00_typescript.js:69000:35)

Expected Result

File will be formatted.

@kitsonk kitsonk added bug Something isn't working correctly lsp related to the language server labels Mar 5, 2021
@kitsonk
Copy link
Contributor

kitsonk commented Mar 5, 2021

#8914 doesn't really have anything to do with this.

Can you provide a more complete reproduction, specifically the code snippet where you were importing the file where you added export {} to it?

@codehz
Copy link

codehz commented Jun 15, 2021

@kitsonk
worker.ts: keep empty
main.ts:

const worker = new Worker(new URL("worker.ts", import.meta.url).href, {
  type: "module",
});
worker.postMessage("");
// and then type anything will trigger this failure

@nayeemrmn
Copy link
Collaborator

Fiixed by #14875.

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

No branches or pull requests

4 participants