scully useScullyTransferState no provide data on PROD
AlonsoK28 opened this issue Β· comments
π Bug report
Description
I had implemented useScullyTransferState
on my app but data.json
is not provided on request
π¬ Minimal Reproduction
- my-service.ts
/**
* Get offers by department Computers and Accessories
*/
getByDepartmentComputersAndAccessories(): Observable<OfferAPIResponse> {
const url = 'getOffersByDepartmentComputersAndAccessories';
return this.transferState
.useScullyTransferState(
'computersAndAccessories',
this.http.get<OfferAPIResponse>(`${this.apiURL}/api/${url}`)
);
}
/**
* Get offers by department Electronic accessories
*/
getByDepartmentGamesAndToys(): Observable<OfferAPIResponse> {
const url = 'getOffersByDepartmentGamesAndToys';
return this.transferState
.useScullyTransferState(
'gamesAndToys',
this.http.get<OfferAPIResponse>(`${this.apiURL}/api/${url}`)
)
}
- my-component.ts
getCurrentDepartmentData() {
const routeUrl = this.router.url;
return of(routeUrl)
.pipe(
switchMap(val => this.getCurrentDepartmentObservable(val))
).subscribe({
next: data => {
if (data[0].offersList.length) {
this.currentMasonryItems = this.applyOrderBy(data[0].offersList);
this.showTopContent = true;
this.showBodyContent = true;
} else {
this.noResults = true;
}
},
error: () => {}
})
}
also data.json
is generated correctly with my API information togheter index.html
when I visit my app hosted into netlify (https://main--amzmation-ssr-1.netlify.app/) to the route "/" is working well and the response of data.json
is well done
But if try to access using a department URL https://main--amzmation-ssr-1.netlify.app/pcs-y-accesorios the response is empty and the data.json
file never is requested
π»Your Environment
Angular Version:
Angular: 14.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1402.10
@angular-devkit/build-angular 14.2.10
@angular-devkit/core 14.2.10
@angular-devkit/schematics 14.2.10
@angular/cli 14.2.10
@schematics/angular 14.2.10
rxjs 7.8.0
typescript 4.8.4
Scully Version:
"@scullyio/init": "^2.1.41",
"@scullyio/ng-lib": "^2.1.0",
"@scullyio/scully": "^2.1.0",
"@scullyio/scully-plugin-puppeteer": "^2.1.0",
π₯ Exception or Error
No exception error specifically from scully, the error is displaying on my app because the data source is empty
any advice about this issue ?
in this case for my department called as "pcs-y-accesorios" the data.json
file is available at https://main--amzmation-ssr-1.netlify.app/pcs-y-accesorios/data.json but never is requested
was an error on my code
stateTransfer is working very well