DEV Community

Discussion on: Why You Should Be Using TransferState (& Scully) to Cache Your API Calls in Angular

Collapse
 
sumitdhameja profile image
Sumeet Dhameja

Thanks for this post Jennifer. When building, I am not seeing any data.json created for that route when running "npm run scully" Is there any config that needs to be enabled?

Collapse
 
hussainb profile image
Hussain

Hi Sumeet, I followed the steps mentioned in this article and the data.json did not get generated for me too.. were you able to make this work for you?

Collapse
 
sumitdhameja profile image
Sumeet Dhameja • Edited

Hi Hussain,
It was long time ago, but I think I had a token interceptor where i was intercepting request and adding Auth token in the header and that was causing the issue for me. When building I used "isScullyRunning" to check and skip it by calling "next"

if (isScullyRunning()) {
      return next.handle(request);
    }
Enter fullscreen mode Exit fullscreen mode

Hope it helps!