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

Upon importing, error: file is not a module #75

Open
NullVoxPopuli opened this issue May 4, 2023 · 0 comments
Open

Upon importing, error: file is not a module #75

NullVoxPopuli opened this issue May 4, 2023 · 0 comments

Comments

@NullVoxPopuli
Copy link

NullVoxPopuli commented May 4, 2023

For example:

import type VerticalCollection from '@gavant/glint-template-types/types/@html-next/vertical-collection';

But that file is a declare module:

declare module '@html-next/vertical-collection/components/vertical-collection' {
    import NativeArray from '@ember/array/-private/native-array';
    import Component from '@ember/component';

    import { SignatureWithPositionedArg } from '@gavant/glint-template-types/utils/types';

    export interface VerticalCollectionArgs<T> {

and declare module doesn't have any exports (it defines exports within it)

So the error I get from

import type VerticalCollection from '@gavant/glint-template-types/types/@html-next/vertical-collection';
error TS2306: 
  File '<long path>@gavant/glint-template-types/types/@html-next/vertical-collection/.d.ts' 
    is not a module.

makes sense.

The solve for now is this:

import '@gavant/glint-template-types/types/@html-next/vertical-collection';

import type VerticalCollection from '@html-next/vertical-collection/components/vertical-collection';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant