"Exported variable X has or is using name DeepArray from external module" typescript error
iamrommel opened this issue · comments
Hey @iamrommel, thanks for reporting the issue.
I don't understand why TS is giving you that error, and I can't seem to be able to reproduce it either. Would you mind sharing a minimal repository with the error so I can take a look here?
A temporary workaround for this appears to be recasting. So, in the OP's case (I think):
export const useContext = () => useContextCore(context as DeepSignal<ContextType>)
I know for myself I had something like the following and was able to fix with casting:
const configuration = deepSignal<Configuration.Settings>({...});
export const useConfiguration = () => configuration as DeepSignalObject<Configuration.Settings>;
Only issue with this is that DeepSignalObject
is ALSO not exported so I had to manually copy/paste it into my own file. Maybe just exporting the types to begin with would be the easiest fix?
DeepSignalArray
and DeepSignalObject
are internal and should not be used directly, only DeepSignal
should be.
Would you mind forking this Stackblitz and reproducing the error so I can take a look to understand what's going on? Thanks! 🙂
I'm going to close this now, but feel free to reopen if you finally have a chance to reproduce the issue.