twobin / twobin/react-lazyload

Circular dependency warning when building with Rollup

Open
#177 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
485
PR merge metrics
No merged PRs in 30d

Description

```
{ code: 'CIRCULAR_DEPENDENCY',
importer: 'node_modules/react-lazyload/lib/index.js',
message: 'Circular dependency: node_modules/react-lazyload/lib/index.js -> node_modules/react-lazyload/lib/decorator.js -> node_modules/react-lazyload/lib/index.js',
toString: [Function] }
```
I can do a PR for this in a week or so if you'd like, looks like `LazyLoad` would have to be moved out of `index.jsx` and then `index.jsx` would only contain this:

```javascript
import decorator from './decorator';
export const lazyload = decorator;
import Lazyload from './lazyload'; // new file
export default LazyLoad;
export { lazyLoadHandler as forceCheck };
```

This way `./decorator` wouldn't import `index.jsx` while `index.jsx` is also importing `./decorator`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.