question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@deno-types does not work on first load

See original GitHub issue

postcsstest.ts

import autoprefixer from "https://jspm.dev/autoprefixer";

// @deno-types="./postcss.d.ts"
import postcss from "https://jspm.dev/postcss";

postcss().use(autoprefixer).process(".something { appearance: none; }", {
    from: undefined
}).then((f: any) => {
    console.log(f.css);
})

postcss.d.ts

export default function(): any;

VSCode problem:

image

Notice that it runs correctly, and deno understands the @deno-types just fine, it’s just this VSCode extension that doesn’t understand these.

Also I think this is the reason for errors elsewhere, e.g. https://github.com/keroxp/servest/issues/133

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
axetroycommented, Aug 30, 2020

Report current progress

Known issues

On the first load, @deno-types failed to load correctly

You only need to make any changes to trigger a refresh

eg. https://github.com/denoland/vscode_deno/blob/master/examples/compile-hint/mod.ts

1

I have been aware of this problem for a long time, but I’m not sure if it’s a bug in typescript or I’m using it incorrectly.

How @deno-types works in typescript-deno-plugin

In fact, typescript-deno-plugin proxy the typescript method of finding modules.

https://github.com/denoland/vscode_deno/blob/5b379fb995e402ef1fbd808d6f8385ebeca87d62/typescript-deno-plugin/src/plugin.ts#L430-L441

When the import xxx from "xxx" statement is detected, and there is // @deno-types="xxxx" in the previous line of code, it will look for the module specified by deno-types.

And return this path

https://github.com/denoland/vscode_deno/blob/5b379fb995e402ef1fbd808d6f8385ebeca87d62/typescript-deno-plugin/src/plugin.ts#L469-L487

https://github.com/denoland/vscode_deno/blob/5b379fb995e402ef1fbd808d6f8385ebeca87d62/typescript-deno-plugin/src/plugin.ts#L530-L542

But it’s very strange that it didn’t take effect the first time it was run, and it only took effect the second.

If someone is good at typescript, please don’t be stingy with your help

1reaction
CGQAQcommented, Sep 30, 2020

KXgQj81unt

really? Microsoft?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Towards Genotype-Specific Care for Chronic Hepatitis B: The ...
Blood for HBV viral load was obtained and, where able, genotype and full genome ... GESA: Resolved infection, HBsAg negative, hepatitis B viral...
Read more >
Errors and warnings - PLINK 1.9 - cog-genomics.org
"No phenotypes present." Not a problem if you aren't performing any association analysis, or if you're explicitly loading phenotype data with --pheno when ......
Read more >
Genetic Dominance: Genotype-Phenotype Relationships
Dominance affects the phenotype derived from an organism's genes, but it does not affect the way these genes are inherited. Complete dominance occurs...
Read more >
Simultaneous Genotyping and Quantification of Hepatitis B ...
Viral load and HBV genotype play critical roles in determining clinical outcomes and response to antiviral treatment in hepatitis B patients. Viral genotype...
Read more >
Problem to load genotype file in Tassel 5.2.3 - Google Groups
3, but I have the following error message: Error loading: C:\mdp_genotype.hmp.txt Taxon [] already exists in the list. Duplicated taxa not allowed. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found