Lama
Lama

Reputation: 31

Attempted import error:' is not exported from

i cant resolve my problem. I have a file where I declare a class with the following code in lama.d.ts

export declare class lama  {


    // code here
}

Then I import this in another file in the same folder of my react project

import { lama} from './lama.d';

But I have the following error : Attempted import error: 'lama' is not exported from './lama.d'.

It does the same in a .ts instead of .d.ts file. And the mostt weird is that if I export another class from this file (lama.d.ts) that I import from another file to lama.d.ts , it works , but not the class that i wantt to work.

thank you for reading me

Upvotes: 3

Views: 12155

Answers (1)

Mhand
Mhand

Reputation: 81

I had the same error, but used export default and it worked!


    declare class lama {
      // code here .. 
      export default lama
    }

When import :

    import lama from './lama.d'

Upvotes: 2

Related Questions