Giter VIP home page Giter VIP logo

Comments (1)

jonkoops avatar jonkoops commented on July 26, 2024

Hi @TestardR, thanks for opening this issue. First off, thank you for creating a repo to help us reproduce the problem this helps a lot in finding and resolving issues.

To support modern browsers and tooling better we include both an ES2015 (with ES modules) version as well as an ES5 (with CommonJS modules). We make use of the module field in the package file to explicitly allow modern tooling to make use of the ESM version.

By default create-react-app will use the ESM version wherever possible, which means that during development you will get an ES2015 version of the code. Naturally this does not work well together with older browsers such as Internet Explorer, as they do not support this modern syntax.

To resolve this problem create-react-app will transform this ES2015 syntax to ES5 in a production build. You can verify this by building your application and serving it locally:

yarn build && npx http-server build/

If you open the address provided by the server you will see that it will actually not produce any syntax errors in Internet Explorer. It will however produce several exceptions that are related to missing APIs such as Object.assign and Object.entries for which you will have to add the correct polyfills.

As mentioned in the create-react-app documentation you will have to add the react-app-polyfill package to your application to support Internet Explorer 11. To do so install the package and add the following line to the top of src/index.js:

// This must be the first line in src/index.js
import 'react-app-polyfill/ie11';

This will take care of the basic polyfills that are needed by React and some of the ones needed for matomo-tracker. For the polyfills that are not included here I would recommend that you use core-js to provide the ones you need. For example since we need a polyfill for Object.entries you will have to include a polyfill as follows:

// This must be the first line in src/index.js
import 'react-app-polyfill/ie11'
import 'core-js/modules/es.object.entries'

I hope this answers your question, if not feel free to drop me a line below.

from matomo-tracker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.