Closed marcopiii closed 4 years ago
How are you importing the module? Looks like you're not doing it correctly, the only reason why you'd get this problem is if your Scry
variable contains something besides scryfall-sdk
. IE the error you're getting is identical to if Scry
was {}
I was importing it as import Scry from "scryfall-sdk"
because with the import assignment like in the documentation i was getting Import assignment cannot be used when targeting ECMAScript modules
at compile time.
I did some tries and both the following formats work!
import { Cards } from "scryfall-sdk";
import * as Scry from "scryfall-sdk";`
thank you and sorry for wasting your time, I hope this can be useful to someone else 👍
I'm getting the following error when I start my React ts app.
TypeError: Cannot read property 'collection' of undefined
The same thing happens with everything I export from
Scry
, likeScry.CardIdentifier
.I think I'm using it as I saw in the documentation.
v1.6.3
v3.7.5
v12.14.1