react-select-async-paginate icon indicating copy to clipboard operation
react-select-async-paginate copied to clipboard

Module Warnings in console

Open rishighan opened this issue 3 years ago • 5 comments

Are you submitting a bug report or a feature request or a question?

bug report

What is the current behavior?

I am using react-select-async-paginate as shown below:

import Creatable from "react-select/creatable";
import { withAsyncPaginate } from "react-select-async-paginate";
const CreatableAsyncPaginate = withAsyncPaginate(Creatable);

// ...

const [value, onValueChange] = useState(null);
  const [isAddingInProgress, setIsAddingInProgress] = useState(false);

  const loadData = useCallback((query, loadedOptions, { page }) => {
    return fetchMetronResource({
      method: "GET",
      resource: props.metronResource,
      query: {
        name: query,
        page,
      },
    });
  }, []);

  return (
    <CreatableAsyncPaginate
      SelectComponent={Creatable}
      debounceTimeout={200}
      isDisabled={isAddingInProgress}
      value={value}
      loadOptions={loadData}
      placeholder={props.placeholder}
      // onCreateOption={onCreateOption}
      onChange={onValueChange}
      // cacheUniqs={[cacheUniq]}
      additional={{
        page: 1,
      }}
    />
  );

// ...

NOTE: The select populates with data, and paginates through it as it should.

However, the console shows these warnings:

"Module Warning (from ./node_modules/source-map-loader/index.js):
(Emitted value instead of an instance of Error) Cannot find source file '../src/index.tsx': Error: Can't resolve '../src/index.tsx' in '/Users/rishi/work/threetwo/node_modules/react-is-mounted-hook/lib'"

What is the expected behavior?

The warnings shouldn't be shown.

Sandbox Link

N/A

What's your environment?

{
  "react": "^17.0.1",
  "react-select": "^5.2.1",
  "react-select-async-paginate": "^0.6.1"
}

Browser: Safari Version 15.3 (17612.4.2.1.2) OS: macOS Monterey

Other information

rishighan avatar Jan 06 '22 13:01 rishighan

Having a similar issue.

WARNING in ./node_modules/react-is-mounted-hook/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '../node_modules/react-is-mounted-hook/src/index.tsx' file: Error: ENOENT: no such file or directory, open '../node_modules/react-is-mounted-hook/src/index.tsx'

SchneckDigital avatar Jan 12 '22 01:01 SchneckDigital

Its due to this issue: https://github.com/hupe1980/react-is-mounted-hook/issues/15

A very tiny lib that only add this:

import { useRef, useEffect, useCallback } from 'react';

export default function useIsMounted(): () => boolean {
  const ref = useRef(false);

  useEffect(() => {
    ref.current = true;
    return () => {
      ref.current = false;
    };
  }, []);

  return useCallback(() => ref.current, [ref]);
}

futhr avatar Jan 13 '22 07:01 futhr

is it work @futhr your and how do i attach in my folder

MoeThet20 avatar Mar 25 '22 09:03 MoeThet20

@MoeThet20 A PR is required, I tried but this repo collides with my editors eslint config to much to do a proper clean PR, you welcome to give it a try.

futhr avatar Apr 01 '22 17:04 futhr

Any update on this?

haresh6x avatar May 23 '22 07:05 haresh6x

This library was removed in version 0.6.2

vtaits avatar Dec 12 '22 08:12 vtaits