I have just made a starting point for an app using create-react-app and react-bootstrap and wanted to see if i could get it running, and much to my suprise it fails with a message that it can’t find one of the modules i’m using from react-bootstrap - log output:
9:17:52 PM: Failed to compile.
9:17:52 PM: ./src/navigation/navigation.tsx
9:17:52 PM: Cannot find module: ‘react-bootstrap/NavBar’. Make sure this package is installed.
9:17:52 PM: You can install this package by running: npm install react-bootstrap/NavBar.
I have tried rebuilding and clearing the cache, but it gives the same error. The Navnar can’t be installed as per the suggestion.
It seems like a issue between the OS’s but i don’t know how to accomodate it, if it’s something inside the module, react-bootstrap and how they organize their code?
I did read the article you link to, but it seems to assume that is a file i’m in control over that is importing something else with a wrong case.
It works if i use the drag and drop way of uploading the files. It’s something about that module react-bootstrap that doesn’t play nice with your machines
I think this is a case sensitive natures of our build environment that you’re running into:
import Nav from 'react-bootstrap/Nav';
import NavBar from 'react-bootstrap/NavBar';
I suspect you develop on OSX or Windows, and those files will be available as react-bootstrap/NavBar or REACT-BOOTSTRAP/NAVBAR or react-bootstrap/navbar - but in our builds, those are all separate files. Recommended best practice is standardizing in your code and the filesystem in lowercase, since it is a bit complicated to reliably change case sensitivity within a git repo from a non-case-sensitive system.
Could you try ALSO changing the case of the import?
so not just this:
import Nav from 'react-bootstrap/nav';
import NavBar from 'react-bootstrap/navbar';
but also this:
import nav from 'react-bootstrap/nav';
import navbar from 'react-bootstrap/navbar';
OK, so perhaps based on @sungmaxxi’s feedback, this is not the problem. I don’t see any site with your build error still @mry-bigweb - your only site does not seem to have ever produced the log you mention (not sure if you renamed it, or removed the other site). If you can link me back to it, I do need to see what settings you use, as I try to reproduce using your package.json in our build environment.