Errors when you debug against a Tier 1 Retail Server virtual machine in an e-commerce development environment
This article provides a resolution for an issue where you might receive an error when you debug against a Tier 1 Retail Server virtual machine (VM) in an e-commerce development environment in Microsoft Dynamics 365 Commerce.
Introduction
Microsoft Dynamics 365 Commerce Tier 1 environments are typically deployed for Commerce runtime (CRT) and point of sale (POS) extension development. They are standalone environments. Because of the software as a service (SaaS) nature of the architecture, they don't include e-commerce components.
In some scenarios, you might need to test calls to extensions in a Tier 1 environment so that you can debug extensions from e-commerce components. For general instructions, see Debug against a Tier 1 Commerce development environment.
Symptoms
When you debug against a Tier 1 environment, because the site is now calling a different Retail Server, cross-server calls might cause various errors that are related to the content security policy.
The following screenshot shows an example of an error that might occur when a variant is selected on a product details page.
Unhandled Rejection (ActionError): Error
The following screenshot shows an example of a similar error in a browser's debugger tools (F12 Developer Tools). The error message mentions a violation of the content security policy directive.
Resolution
To solve this issue, disable the content security policy (CSP) for the site in Dynamics 365 Commerce site builder.
- Select the site that you're working on.
- Select Settings > Extensions.
- On the Content security policy tab, select Disable content security policy.
- Select Save and publish.
Note
Business-to-consumer (B2C) sign-in won't work in a local development environment. However, you can use guest checkouts or build page mocks to simulate a user sign-in as required.
More information
Get started with e-commerce online extensibility development
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for