Search code examples
react-bootstrap

React-bootstrap: WARNING in ./node_modules/@react-aria/ssr/dist/SSRProvider.mjs


I have been working with React-bootstrap for more than a year but recently found this problem: whenever importing a react-bootstrap component, there will be a warning with react-aria (which is a dependency of restart/ui, and restart/ui is a dependency of react-bootstrap): WARNING in ./node_modules/@react-aria/ssr/dist/SSRProvider.mjs Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from 'my-root-directory\node_modules@react-aria\ssr\dist\SSRProvider.mjs.map' file: Error: ENOENT: no such file or directory, open 'my-root-directory\node_modules@react-aria\ssr\dist\SSRProvider.mjs.map' This warning shouldn’t affect the runtime of my application, as source maps are primarily used for debugging purposes, but it still pretty annoying. Im using the latest react-bootstrap version: 2.10.2. Is this a new bug and how to solve it?

I have search for issues in both react-bootstrap, restart/ui and react-aria github page, but there is no issue mentioning this


Solution

  • I am also experiencing similar problem Do you think there might be a problem with the import in my case? Did you disassemble the structure and import it? If so, I think it will be processed by writing it line by line using the import method provided on the React-bootstrap homepage. I hope you try one more time

    // import {Button, Navbar, Container, Nav} from 'react-bootstrap';
    
    import Button from 'react-bootstrap/Button';
    import Navbar from 'react-bootstrap/Navbar';
    import Container from 'react-bootstrap/Container';
    import Nav from 'react-bootstrap/Nav'