LottieFiles / lottie-react

lottie web player as a react component
https://lottiefiles.com
MIT License
720 stars 80 forks source link

Warning because of types not correctly mapped #86

Closed rgazelot closed 2 years ago

rgazelot commented 2 years ago

Hello

When I start my server or build my project using CRA v5 I have these messages:

WARNING in ./node_modules/@lottiefiles/react-lottie-player/dist/lottie-react.esm.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/@lottiefiles/react-lottie-player/src/Seeker.tsx' 
file: Error: ENOENT: no such file or directory, open '/node_modules/@lottiefiles/react-lottie-player/src/Seeker.tsx'

In fact types are located in /node_modules/@lottiefiles/react-lottie-player/dist/src but it seems that the lottie-react.esm.js.map says:

{"version":3,"file":"lottie-react.esm.js","sources":["../src/Player.tsx","../node_modules/style-inject/dist/style-inject.es.js","../src/ColorPicker.tsx","../src/Popover.tsx","../src/Seeker.tsx","../src/Controls.tsx"] ...}

The source map file is pointing to ../src instead of /src.

I don't really know if it's a config issue on my side or the package was badly built and published on npm.

Thanks a lot for your help

samuelOsborne commented 2 years ago

Thanks for creating this issue @rgazelot, looking in to it.

samuelOsborne commented 2 years ago

hey @rgazelot, this should be fixed with v3.4.6. Cheers!

rgazelot commented 2 years ago

I confirm that I don't have the warnings anymore. Good job team