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.

Incompatible with Deno 1.4.[0,1,2] due to deno adopting tsconfig settings importsNotUsedAsValues and isolatedModules

See original GitHub issue

In version 1.4 Deno adopted;

These require the use of;

  • type only imports for values which are only used as types (importsNotUsedAsValues)
  • type only exports for types which are re-exported (isolatedModules)

From the errors I’m seeing with our tool which makes use of yargs from deno, this will require updates to the types for yargs, y18n and yargs_parser along the following lines.

# https://deno.land/x/y18n@v5.0.0-deno/deno.ts:2:1
- import { Y18NOpts } from './build/lib/index.d.ts'
+ import type { Y18NOpts } from './build/lib/index.d.ts'
# https://deno.land/x/yargs@v16.0.3-deno/types.ts#L6
// expose types for the benefit of Deno.
- import { YargsInstance as YargsType, Arguments } from './build/lib/yargs-factory.d.ts'
+ import type { YargsInstance as YargsType, Arguments } from './build/lib/yargs-factory.d.ts'

- export {
+export type {
  Arguments,
  YargsType
}

While there is a possible workaround of overriding these in a custom tsconfig, from 1.5 deno have indicated they will ignore any custom value for importsNotUsedAsValues from 1.5 onwards https://github.com/denoland/deno/pull/7413#issuecomment-691127947.

I’ll open Pull Requests for these shortly, just getting the repos setup locally.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bcoecommented, Oct 1, 2020

@luke-john let’s make the changes for now, without switching CI/CD to unstable – since it unblocks you.

Then we’ll just be mindful as v1.5 comes out.

1reaction
bcoecommented, Sep 30, 2020

@luke-john whoops, slight issue with:

https://github.com/yargs/yargs-parser/pull/329

Mind recreating the PR with the PR being against master. The deno branch is automatically generated whenever we perform a release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use isolatedModules · Issue #7326 · denoland/deno - GitHub
Incompatible with Deno 1.4.[0,1,2] due to deno adopting tsconfig settings importsNotUsedAsValues and isolatedModules yargs/yargs#1771.
Read more >
Configuration | Manual - Deno
To use a TypeScript configuration file with Deno, you have to provide a path on the command line. For example: > deno run...
Read more >
Typescript Import Problem after updating Deno - Stack Overflow
Setting tsconfig like this will solve the problem { "compilerOptions": { "importsNotUsedAsValues": "remove", "isolatedModules": false, } }.
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