dlevs / duration-fns

Functions for working with durations.
MIT License
58 stars 6 forks source link

Error "Failed to parse source map from ..." when using Create React App v5 #28

Closed camillef closed 2 years ago

camillef commented 2 years ago

When importing this library in an app using Create React App v5, npm start throws up a bunch of the following errors

WARNING in ./node_modules/duration-fns/dist/abs.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/camillef/Code/app/node_modules/duration-fns/src/abs.ts' file: Error: ENOENT: no such file or directory, open '/Users/camillef/Code/app/node_modules/duration-fns/src/abs.ts'

According to https://github.com/facebook/create-react-app/discussions/11767 this is because duration-fns is not correctly including sourcemaps in its npm package

dlevs commented 2 years ago

Interesting, thanks for reporting! Is this something you can raise a pull request for? If there is a change you can make to the project to fix this, I'll happily merge it and publish a new version of this library.

camillef commented 2 years ago

Is this something you can raise a pull request for?

Yup! Done here: https://github.com/dlevs/duration-fns/pull/29