Skip to main content

Notifications

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

  • WillWU Profile Picture
    22,357 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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Zain Mehmood Profile Picture

Zain Mehmood 462 Moderator

#2
Danny Bilodeau Profile Picture

Danny Bilodeau 156 Moderator

#3
Laurens vd Tang Profile Picture

Laurens vd Tang 120 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans