Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with parsing 'react-transition-group' #77

Closed
sceptre12 opened this issue Nov 10, 2022 · 2 comments
Closed

Issue with parsing 'react-transition-group' #77

sceptre12 opened this issue Nov 10, 2022 · 2 comments

Comments

@sceptre12
Copy link

sceptre12 commented Nov 10, 2022

Hello I'm having an issue parsing the 'react-transition-group' library.
I'm using react-transition-group version: "^2.6.1"

When attempting to parse the "react-transition-group/index.js " file that contains the content below:

"use strict";

var _CSSTransition = _interopRequireDefault(require("./CSSTransition"));

var _ReplaceTransition = _interopRequireDefault(require("./ReplaceTransition"));

var _TransitionGroup = _interopRequireDefault(require("./TransitionGroup"));

var _Transition = _interopRequireDefault(require("./Transition"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = {
  Transition: _Transition.default,
  TransitionGroup: _TransitionGroup.default,
  ReplaceTransition: _ReplaceTransition.default,
  CSSTransition: _CSSTransition.default
};

Parsing example:

const { parse } = require('cjs-module-lexer');
const result = parse([The string above]);

The output I get is: result.exports = [Transition]

When I remove the default from this: _Transition.default
So it's now _Transition

the output from the parse is now:
result.exports = [Transition, TransitionGroup]

Is the parsing stopping the moment it finds a default inside of a module.exports object?

@guybedford
Copy link
Collaborator

Yes this is correct and by design, parsing on module.exports = { ... } internals stops the moment you use a . within the ... part since it does not do complete expression parsing.

@sceptre12
Copy link
Author

Ohh dang.. is there any way around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants