I have the following reference import { STORE } from "../data/store";
It's part of a react project and works as expected.
However I need to run some code separately over STORE and accessed it the same way as it is in the react project, but ran via ts-node
. When I try to access STORE
by let data = STORE[videoId].labels;
, with videoId
set as "home"
I get TypeError: Cannot read property 'home' of undefined
.
Might anyone know what I'm missing --- must be something specific to ts-node...? Thanks!
It sounds like the property STORE is undefined..
If you change
import { STORE } from "../data/store";
toimport * as STORE from "../data/store"
does it work?