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.

This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

See original GitHub issue
  • I am on the latest ember-intl version
  • I have searched the issues of this repo and believe that this is not a duplicate

Environment

  • Ember Version: 3.25.x

  • Ember CLI Version: 3.25.x

  • Ember Intl Version: 5.6.2

  • Browser(s): n/a

  • Node Version: n/a

  • TypeScript: 4.2.4

  • Using composite TS configs

    • not even sure which project in the monorepo is causing this, because this is the sole error

Steps to Reproduce

Not sure yet, but here is what I’m getting:

 tsc --build --clean && tsc --build
node_modules/ember-intl/addon/-private/formatters/-base.ts:8:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

8 import { Formats } from '../../types';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
NullVoxPopulicommented, May 6, 2021

Here is the referenced code: https://github.com/ember-intl/ember-intl/blob/main/addon/-private/formatters/-base.ts#L7

and the error makes sense. The import should be import type { Formats } ..., but I don’t yet know why it even matters since its in node_modules, and importsNotUsedAsValues is a project-level setting?

2reactions
hadiwinacommented, Jan 20, 2022

@buschtoens I found another potential similar issue here. I think that this is also supposed to be import type { Formats, Translations }?

I’ll find some time today or tomorrow to open another PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript Import Problem after updating Deno - Stack Overflow
I recently update deno from v1.3.0 to v1.4.0. Before updating, my code doesn't have ...
Read more >
What is the point of importsNotUsedAsValues? What ... - Reddit
This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'. But what is the...
Read more >
TypeScript 3.8 edge case type-only auto-import bug?
TS1371 : This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'. This...
Read more >
TSConfig Option: importsNotUsedAsValues - TypeScript
TSConfig. importsNotUsedAsValues ... How to provide a type shape to JavaScript objects. Narrowing. How TypeScript infers types based on runtime behavior.
Read more >
Leveraging Type-Only imports and exports with TypeScript 3.8
And I couldn't notice what was wrong where I was using that type: ... for cases where a type is imported only to...
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