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

Corejs dependancy issue #387

Closed
KrishnaPrasanthVemuganti opened this issue Oct 18, 2019 · 9 comments
Closed

Corejs dependancy issue #387

KrishnaPrasanthVemuganti opened this issue Oct 18, 2019 · 9 comments
Labels

Comments

@KrishnaPrasanthVemuganti

Getting the below error when using simplebar-react in gatsby based application

failed Building development bundle - 6.396s

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.filter' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.for-each' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.iterator' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.assign' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.to-string' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.parse-int' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.string.iterator' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.weak-map' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/web.dom-collections.iterator' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

Below are the node dependencies used

"dependencies": {
"@emotion/core": "^10.0.21",
"gatsby": "^2.16.5",
"gatsby-plugin-react-helmet": "^3.1.13",
"gatsby-plugin-sass": "^2.1.20",
"gatsby-plugin-typography": "^2.3.14",
"node-sass": "^4.12.0",
"react": "^16.10.2",
"react-burger-menu": "^2.6.11",
"react-dom": "^16.10.2",
"react-helmet": "^5.2.1",
"react-icons": "^3.7.0",
"react-spinners": "^0.6.1",
"react-typography": "^0.16.19",
"simplebar-react": "^2.0.1",
"typography": "^0.16.19",
"typography-theme-github": "^0.16.19"
},
"devDependencies": {
"prettier": "^1.18.2"
}

Please let me know if you need more info

Thanks,
Krishna

@Grsmto
Copy link
Owner

Grsmto commented Oct 18, 2019

Gatsby uses core-js 2 and SimpleBar core-js 3.
It's written in the README If you are using Gatsby, please see #345..
Try with simplebar-react@2.0.2-corejs2 .

@KrishnaPrasanthVemuganti
Copy link
Author

i have updated simplebar-react@2.0.2-corejs2

Getting below error now:

failed Building development bundle - 6.563s

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'can-use-dom' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'lodash.debounce' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'resize-observer-polyfill' in '/Users/.../node_modules/simplebar/dist'

File: node_modules/simplebar/dist/simplebar-core.esm.js

@Grsmto
Copy link
Owner

Grsmto commented Oct 18, 2019

Can you try again with simplebar-react@2.0.2-corejs2-1?
Seems like it's working now https://codesandbox.io/s/gatsby-starter-default-v7kqt

@KrishnaPrasanthVemuganti
Copy link
Author

Working now... thanks a-lot for quick replies and fix...

@KrishnaPrasanthVemuganti
Copy link
Author

KrishnaPrasanthVemuganti commented Oct 19, 2019

Sorry to reopen the issue

geting another error when deploying to netlify

11:52:50 AM: failed Building static HTML for pages - 2.911s
11:52:50 AM: error "window" is not available during server side rendering.
11:52:50 AM: 22 | var cachedScrollbarWidth = null;
11:52:50 AM: 23 | var cachedDevicePixelRatio = null;
11:52:50 AM: > 24 | window.addEventListener('resize', function () {
11:52:50 AM: | ^
11:52:50 AM: 25 | if (cachedDevicePixelRatio !== window.devicePixelRatio) {
11:52:50 AM: 26 | cachedDevicePixelRatio = window.devicePixelRatio;
11:52:50 AM: 27 | cachedScrollbarWidth = null;
11:52:50 AM:
11:52:50 AM: WebpackError: ReferenceError: window is not defined
11:52:50 AM:
11:52:50 AM: - simplebar-core.esm.js:24 Module../node_modules/simplebar/dist/simplebar-core .esm.js
11:52:50 AM: node_modules/simplebar/dist/simplebar-core.esm.js:24:1
11:52:50 AM:
11:52:50 AM: - simplebar-react.esm.js:1 Module../node_modules/simplebar-react/dist/simpleba r-react.esm.js
11:52:50 AM: node_modules/simplebar-react/dist/simplebar-react.esm.js:1:1
11:52:50 AM:
11:52:50 AM: - main.js:1 Module../src/components/main.js
11:52:50 AM: src/components/main.js:1:1
11:52:50 AM:
11:52:50 AM: - container.js:1 Module../src/components/container.js
11:52:50 AM: src/components/container.js:1:1
11:52:50 AM:
11:52:50 AM: - index.js:1 Module../src/pages/index.js
11:52:50 AM: src/pages/index.js:1:1

Issue fix for your reference: bitworking/react-gsap#1

@NechiK
Copy link

NechiK commented Oct 21, 2019

It looks like window issue was fixed here #388

@KrishnaPrasanthVemuganti
Copy link
Author

i am using simplebar-react@2.0.2-corejs2-1 version and i dont see the above change there can you please verify....

@Grsmto
Copy link
Owner

Grsmto commented Oct 21, 2019

Awaiting change before merging PR to fix this in #388

@Grsmto
Copy link
Owner

Grsmto commented Oct 21, 2019

I will close this issue as this is unrelated. Please follow up on #390.

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

No branches or pull requests

3 participants