alibaba / react-intl-universal

Internationalize React apps. Not only for Component but also for Vanilla JS.
1.33k stars 154 forks source link

Can the console-polyfill dependency be removed? #182

Closed kaiyoma closed 2 years ago

kaiyoma commented 2 years ago

I'm running into a problem with a project that uses this package:

.../common/temp/node_modules/.pnpm/console-polyfill@0.3.0/node_modules/console-polyfill/index.js:13
  if (!global.console) {
              ^

TypeError: Cannot read properties of undefined (reading 'console')

Why does this package need console-polyfill? Browsers and Node both have a console, so the polyfill seems unnecessary. (I've never seen any other npm package use that dependency.) I cloned this project and manually removed that dependency and the build still works and I get the same pass rate for the unit tests. Can the console-polyfill dependency be removed?

cwtuan commented 2 years ago

fixed in react-intl-universal@2.5.1.