You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?:
Report a bug
What is the current behavior?:
const{ extractReactIntl }=require('extract-react-intl-messages');// extractReactIntl is undefined
What is the expected behavior?:
The symbol is exported from the module, so I want to be able to import it.
Suggested solution:
In index.ts, at line 67, you do
exportconstextractReactIntl=_extractReactIntl
But at line 138 you write this
module.exports=extractMessage
For CommonJS, line 67 is transpiled to exports.extractReactIntl = _extractReactIntl, so at line 138 you overwrite completely exports.
Easiest fix, since you want to be able to use require without .default, would be simply to assign extractReactIntl as a property of extractMessage:
extractMessage.extractReactIntl=_extractReactIntlexportdefaultextractMessage// For CommonJS default export supportmodule.exports=extractMessagemodule.exports.default=extractMessage
This way you don't change your API (but on the other hand you always get extractReactIntl when you import default, which is not problematic given that this module is not meant to be used in a tree-shaking context).
The text was updated successfully, but these errors were encountered:
node
version: 10.16.0npm
(oryarn
) version: yarn 1.19.1Do you want to request a feature or report a bug?:
Report a bug
What is the current behavior?:
What is the expected behavior?:
The symbol is exported from the module, so I want to be able to import it.
Suggested solution:
In
index.ts
, at line 67, you doBut at line 138 you write this
For CommonJS, line 67 is transpiled to
exports.extractReactIntl = _extractReactIntl
, so at line 138 you overwrite completelyexports
.Easiest fix, since you want to be able to use require without
.default
, would be simply to assignextractReactIntl
as a property ofextractMessage
:This way you don't change your API (but on the other hand you always get
extractReactIntl
when youimport default
, which is not problematic given that this module is not meant to be used in a tree-shaking context).The text was updated successfully, but these errors were encountered: