web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

E-commerce SDK work around for build error: 'Image' cannot be used as a JSX component. "Its instance type 'Image' is not a valid JSX element"

(0) ShareShare
ReportReport
Posted on by

A recent error was discovered when building the e-commerce online SDK if you are using the "Image" component within your customization, you will see a build error:

'Image' cannot be used as a JSX component. "Its instance type 'Image' is not a valid JSX element"

The root cause is due to a dependency component recently took a dependency on React 18.x which conflicts with other dependencies taking a dependency on version 16.x.  The work around is to specify the version in the resolutions section of the package.json file to include "@types/react": "16.9.0", as shown below:

...

  "resolutions": {

    "@msdyn365-commerce/bootloader": "^1.0.0",
    "@msdyn365-commerce/core": "^1.0.0",
    "@msdyn365-commerce-modules/core-components": "^1.0.0",
    "axios": "^0.21.1",
    "@types/react": "16.9.0"
  }
After saving the file, run "yarn" to pull down the appropriate version.  Running "yarn start" or "yarn msdyn365 pack" should now build without errors.

A fix has been published to the online SDK package.json file, however if you already have pulled down the SDK from the GitHub repo, you will need to manually apply the fix as shown above.

thanks,

Sam

I have the same question (0)
  • WillWU Profile Picture
    22,359 on at
    RE: E-commerce SDK work around for build error: 'Image' cannot be used as a JSX component. "Its instance type 'Image' is not a valid JSX element"

    Thank you for your sharing.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 180 Super User 2025 Season 2

#2
Yng Lih Profile Picture

Yng Lih 130

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 104 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans