Simplebar: Corejs dependancy issue

Created on 18 Oct 2019  路  9Comments  路  Source: Grsmto/simplebar

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

question

All 9 comments

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 [email protected].

i have updated [email protected]

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

Can you try again with [email protected]?
Seems like it's working now https://codesandbox.io/s/gatsby-starter-default-v7kqt

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

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: https://github.com/bitworking/react-gsap/issues/1

It looks like window issue was fixed here https://github.com/Grsmto/simplebar/pull/388

i am using [email protected] version and i dont see the above change there can you please verify....

Awaiting change before merging PR to fix this in #388

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adjourn picture adjourn  路  6Comments

apopelyshev picture apopelyshev  路  7Comments

TheeOhioState picture TheeOhioState  路  6Comments

idiotWu picture idiotWu  路  3Comments

RennerBink picture RennerBink  路  3Comments