Giter Club home page Giter Club logo

Comments (8)

mysticatea avatar mysticatea commented on May 27, 2024

Thank you for this issue.

I guess that you used a minifier which doesn't support ES2015, then it was thrown at ES2015 syntax. Please try to transpile both abort-controller and event-target-shim also by Babel.

from event-target-shim.

braco avatar braco commented on May 27, 2024

+1, this is the only module that doesn't build out of a few hundred.

from event-target-shim.

lsiden avatar lsiden commented on May 27, 2024

@Antman261 and @braco, I found two workarounds for this but neither one is satisfying:

  1. Copy abort-controller.js, abort-signal.js and event-target-shim.js to your own project and change the import statements to match.
  2. eject and comment out or delete the initialization of webpack.optimize.UglifyJsPlugin in you webpack.config.production.

I don't like either workaround. (2) makes the output bundle twice as big.

The basic problem is that it was written in ES6 and needs to be transpiled to ES5 to meet CRA's expectation for everything under node_modules/. An easy fix is to transpile the code to ES5, but the authors already set it up this way and changing it might break it for others that are already using it.

Feel free to share any thoughts. abort-controller et al are highly useful modules for some apps and I'd like to be able to use them in other projects with less resistance.

from event-target-shim.

mysticatea avatar mysticatea commented on May 27, 2024

I think Webpack 4 supports ES2015 in minification.

from event-target-shim.

lsiden avatar lsiden commented on May 27, 2024

Sounds good, but both the master branch and the latest release of react-scripts (packaged with with create-react-app) is still importing [email protected]. Until then, I have no choice but to suffice with one of the workarounds I mentioned.

from event-target-shim.

fadomire avatar fadomire commented on May 27, 2024

same issue here but i'm running Webpack 4
this is the only node_module that is not already transpiled to ES5

from event-target-shim.

GeorgeTaveras1231 avatar GeorgeTaveras1231 commented on May 27, 2024

I believe this problem will be fixed by #23

from event-target-shim.

mysticatea avatar mysticatea commented on May 27, 2024

I had intended this package is used along with bundlers, and if you want to support IE11, you should configure your bundlers to transpile application.

But, as mentioned, some build tools don't look transpiling node_modules.
Therefore, since 6.0.0, this package includes ES5 build. Use import {} from "event-target-shim/es5" instead.

from event-target-shim.

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.