Giter Site home page Giter Site logo

Comments (3)

MatthieuLemoine avatar MatthieuLemoine commented on June 8, 2024

@ydatech CRA uses Webpack@^3 which is bundled with a version of UglifyJS that does not support ES6. Webpack@^4 is bundled with a new version of UglifyJS that can parse ES6.

Four solutions here :

  • Waiting for https://github.com/facebook/create-react-app/pull/4077 to be merged
  • Add a transpilation step with Babel in electron-push-receiver
  • Eject from CRA and update your webpack config with an imported version of UglifyJS (not the bundled one)
  • Eject from CRA and update your webpack config to make it transpile electron-push-receiver

from electron-push-receiver.

ydatech avatar ydatech commented on June 8, 2024

@MatthieuLemoine
I have fixed the issue by moving constants from src/constants/index.js file to local variable in entrypoint src/index.js.. and also I changed the dependency of push-receiver to dev-master because it also causes build error if we use latest stable version..

Note: Create React App can consume both CommonJS and ES modules. For Node.js compatibility, it is recommended that the main entry point is CommonJS. However, they can optionally provide an ES module entry point with the module field in package.json. Note that even if a library provides an ES Modules version, it should still precompile other ES6 features to ES5 if it intends to support older browsers.

this is my fork: https://github.com/ydatech/electron-push-receiver

from electron-push-receiver.

MatthieuLemoine avatar MatthieuLemoine commented on June 8, 2024

Fixed in v2.1.2 thanks to @NBoychev #36

from electron-push-receiver.

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.