rommguy/react-custom-scroll

Failure to Compile

I2obiN opened this issue ยท 15 comments

image

These are my dependencies for package.json
"@date-io/date-fns": "^1.3.13",
"@material-ui/core": "^4.8.0",
"@material-ui/icons": "^4.5.1",
"@material-ui/pickers": "^3.2.8",
"axios": "^0.19.0",
"bootstrap": "^4.4.1",
"date-fns": "^2.8.1",
"draft-js": "^0.11.5",
"draft-js-export-html": "^1.4.1",
"node-sass": "^4.14.1",
"react": "^16.12.0",
"react-app-polyfill": "^1.0.6",
"react-custom-scroll": "^4.2.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.1",
"react-select": "^3.0.8",
"react-transition-group": "^4.4.1",
"reactstrap": "^8.2.0",
"typeface-roboto": "0.0.54"

Looks like a duplicate of #85. Am I right?

Is it possible you somehow take the source code instead of the babel compiled code?
How do you import CustomScroll?

Yeh looks like a duplicate. I just ran npm install as per readme

Did it work? no build errors?

Yep, I'm aware of the vulnerability, but other then that - did you manage to build and render your app?

Oh yeh app built fine, when I drop the element into code I get the error. It's inside a reactstrap modal.

I can't understand, sorry.
You render CustomScroll, after you import it from your node modules right?
The error you pasted above is during the npm install stage, but it is a warning, it does not break the npm install.
When you render your code with CustomScroll, do you see another error?

Yep. Sorry when you asked did it work I thought you meant the npm install. When I render CustomScroll I see the error in my first comment.

NP.
How do you import CustomScroll in your code?
Can you paste the import line here?
The correct way is to install it with npm -
npm install react-custom-scroll
and then import it like so -
import CustomScroll from 'react-custom-scroll'`

I know the npm install shows a warning, it shouldn't stop you, and I'll fix it in the next version

image

image

ok, cool, we found the problem!
You shouldn't import from /src folder, you should import the already compiled version.
Replace the import line in your code with this -

import CustomScroll from 'react-custom-scroll'
`

Ah thanks. Working now, much appreciated dude ๐Ÿ‘

Excellent! glad to hear
I would appreciate it if you could star this repo.

In general - don't import src files from npm packages, only the exported compiled files.

@I2obiN I just published version 4.2.1 that fixes the vulnerability you saw when installing with npm