sneas / img-comparison-slider

Image comparison slider. Compare images before and after. Supports React, Vue, Angular.
https://img-comparison-slider.sneas.io
MIT License
657 stars 47 forks source link

Failed to parse source map, React package #111

Closed romanstetsyk closed 1 year ago

romanstetsyk commented 1 year ago

I'm using this package in a React application set up with create-react-app. When I import the slider with

import { ImgComparisonSlider } from "@img-comparison-slider/react";

It causes an error

Failed to parse source map from '/Users/roman/Documents/img-comparison-slider-test/node_modules/@img-comparison-slider/react/src/index.tsx' file: Error: ENOENT: no such file or directory, open '/Users/roman/Documents/img-comparison-slider-test/node_modules/@img-comparison-slider/react/src/index.tsx'

This doesn't really affect the application, but having the warning is annoying. As a workaround, I can do something like this:

import "img-comparison-slider";

<img-comparison-slider>
  <img slot="first" src={srcFirst} alt="" />
  <img slot="second" src={srcSecond} alt="" />
</img-comparison-slider>

But I can't style the slider with styled-components or emotion in this case. Unfortunately, disabling source maps is not an option.

sneas commented 1 year ago

:tada: This issue has been resolved in version @img-comparison-slider/react-v7.8.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: