facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
227.37k stars 46.37k forks source link

Bug: can't running app, library react-use-set appear after new install #26732

Closed saskekizaki closed 1 year ago

saskekizaki commented 1 year ago

React version: 17.0.2 node version: 18.12.1

my package.json

{ "name": "material-kit-2-react", "version": "2.0.0", "private": true, "dependencies": { "@dnd-kit/core": "^6.0.7", "@dnd-kit/modifiers": "^6.0.1", "@dnd-kit/sortable": "^7.0.2", "@dnd-kit/utilities": "^3.2.1", "@emotion/cache": "11.4.0", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@mui/icons-material": "5.2.0", "@mui/material": "5.2.0", "@mui/styled-engine": "5.2.0", "@mui/x-date-pickers": "^5.0.16", "@rsuite/icons": "^1.0.2", "@rsuite/responsive-nav": "^5.0.1", "@testing-library/jest-dom": "5.11.4", "@testing-library/react": "11.1.0", "@testing-library/user-event": "12.1.10", "axios": "^1.2.1", "chroma-js": "2.1.2", "debounce": "^1.2.1", "dotenv": "^8.6.0", "draft-js": "^0.11.7", "draftjs-to-html": "^0.9.1", "flatpickr": "4.6.9", "html-to-draftjs": "^1.5.0", "moment": "^2.29.4", "prop-types": "15.7.2", "react": "17.0.2", "react-copy-to-clipboard": "5.0.4", "react-countup": "6.1.0", "react-dom": "17.0.2", "react-draft-wysiwyg": "^1.15.0", "react-flatpickr": "3.10.7", "react-google-recaptcha": "^2.1.0", "react-horizontal-scrolling-menu": "^3.2.3", "react-idle-timer": "^5.5.3", "react-player": "2.11.0", "react-redux": "^8.0.5", "react-router-dom": "6.0.2", "react-scripts": "4.0.3", "react-syntax-highlighter": "15.4.5", "redux": "^4.2.0", "rsuite": "^5.23.2", "video-react": "^0.16.0", "web-vitals": "1.0.1", "xlsx": "^0.16.9" }, }

Steps To Reproduce

  1. delete package-lock.json
  2. delete folder node_modules
  3. npm install
  4. npm run start

The current behavior

failed to compile

./node_modules/react-use-set/dist/index.mjs
Can't import the named export 'useCallback' from non EcmaScript module (only default export is available)

Screen Shot 2023-04-26 at 13 58 44

The expected behavior

running app

Bibooo25730 commented 1 year ago

mkdir webpack-test cd webpack-test npm init -y npm install --save graphql webpack webpack-cli ./node_modules/.bin/webpack-cli index.js

ashookumar14 commented 1 year ago

We are facing the same issue

./node_modules/react-use-set/dist/index.mjs
Can't import the named export 'useCallback' from non EcmaScript module (only default export is available)

FROM alpine FROM ubuntu FROM node*

Any node version from 14.21 to 18.0 same behaviour.

asisenevi89 commented 1 year ago

I'm using the rsuite package and having the same problem

asisenevi89 commented 1 year ago

Seems like issue is with the "rsuite" package. It doesn't support named imports.

example

import { Slider } from rsuite; // don't do this import Slider from rsuite/Slider // do this

gaearon commented 1 year ago

This error message is not coming from React. We use this bug tracker for bugs in React.

hussaindatabeat commented 8 months ago

Facing the same issue. Can anyone help here, please??

fyr,https://github.com/facebook/react/issues/26732#issue-1684426716

wahyunurarizky commented 4 days ago

I am facing the same issue