RE: E-commerce React props.context.app returns {"config":{},"routes":{}} even though app.settings.json has content
Hi Brady,
I appreciate your help. I had been trying to access the props.context.app properties inside of a component module and the config and routes would always be empty objects, even though in the app.settings.json (locally) there is lots of stuff.
Now I tried running the console command you provided when visiting the index page and then in a module preview.
https://localhost:4000/ will show config and routes with lots of properties inside of them, but not what I have in local app.settings.json, probably what is on actual live dev site that my env file points to. Does this sound right?
localhost:4000/ [when I paste as url, and save post, it is truncated] modules?type=helloworld will show config {} and routes {} as empty objects.
---
Update:
I cloned new instance of https://github.com/microsoft/Msdyn365.Commerce.Online and did not update the .env file. Testing the preview localhost:4000/modules for the helloworld module returned negative result, same when testing default page mock https://localhost:4000/page?mock=default-page.
After the above, I added the info to the .env file, ran the page mock for default page and the preview for hello world and both returned config and routes as empty objects.
But pointing browser to index page of https://localhost:4000/ and ___initialData___.requestContext.app in console window shows config, routes, contentSecurityPolicy, and platform all populated with values from remote dev server.
I had expected to always see the local app.settings.json values, whether in a page, container, or content component. I am new to D365 (1 week with only training from the documentation on learn.microsoft.com/.../commerce-architecture)