0

Our organization is using the base code as given in the below mentioned Github repository for client side embedding of the JSS react application in Sitecore 9:-

https://github.com/Sitecore/jss/tree/dev/samples/sitecore-embedded-jss-app

The JSS application is included as minified javascript bundles in the Sitecore website.

On running the application in IE11, we receive the following errors:-

  1. SCRIPT1003: Expected ':' - This error comes in the wcms-jss-client.bundle.js file (This bundle is created using the Commonschunkplugin as mentioned in the webpack.client.js file in the build folder of the Github repository.
  2. SCRIPT5009: 'webpackJsonp' is undefined - This error comes in the client.bundle.js file that is generated using webpack for the webpack.shared.js file in the build folder of the Github repository & it corresponds to the Client.js entry point.

In order to resolve the above mentioned issues, we installed & added the entry for babel-polyfill in webpack.client.js as mentioned below:-

const merged = merge({}, expandedSharedConfig, {
    name: 'client',
    target: 'web',
    entry: {
      // main entry point for the client application; src/client.js
      client: ['babel-polyfill', './client.js'],
    },
  });

Also, in order to resolve the second issue that was related to webpackJsonp, we added the below mentioned rule to the webpack module section in webpack.shared.js file:-

rules: [{
      exclude: /node_modules\/(?!(color-convert|ansi-styles|strip-ansi|ansi-regex|debug|react-dev-utils|chalk)\/).*/
  }]

Although, the JSS react application worked in IE11. However, after client side embedding the application bundles in Sitecore as below:-

 <script src="/dist/wcms-jss-app/wcms-jss-client.bundle.js"></script>
 <script src="/dist/wcms-jss-app/client.bundle.js"></script>

the same errors are encountered in IE11.

Can someone help in this regard?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.