I am trying to include react-bootstrap js files into my project for a couple of hours. I am new to react and I will only use it for client side. I tried to include from CDN, could not get it worked (React-Bootsrap Uncaught ReferenceError: require is not defined)
This time I have downloaded packages via npm and then copy whole node_modules folder in my spring boot project.I tried to include files as below, and did not wrote any other code, just included.
<script src="${pageContext.request.contextPath}/node_modules/react/cjs/react.development.js"></script>
<script src="${pageContext.request.contextPath}/node_modules/react-dom/cjs/react-dom.development.js"></script>
<script src="${pageContext.request.contextPath}/node_modules/react-bootstrap/dist/react-bootstrap.js"></script>
However I am getting error below :
react.development.js:14 Uncaught ReferenceError: process is not defined
at react.development.js:14
(anonymous) @ react.development.js:14
react-dom.development.js:14 Uncaught ReferenceError: process is not defined
at react-dom.development.js:14
(anonymous) @ react-dom.development.js:14
react-bootstrap.js:2218 Uncaught TypeError: Cannot read property 'Component' of undefined
at Object.exports.__esModule (react-bootstrap.js:2218)
at __webpack_require__ (react-bootstrap.js:30)
at Object.exports.__esModule (react-bootstrap.js:450)
at __webpack_require__ (react-bootstrap.js:30)
at Object.exports.__esModule (react-bootstrap.js:62)
at __webpack_require__ (react-bootstrap.js:30)
at exports.__esModule (react-bootstrap.js:50)
at react-bootstrap.js:53
at webpackUniversalModuleDefinition (react-bootstrap.js:9)
at react-bootstrap.js:10
exports.__esModule @ react-bootstrap.js:2218
__webpack_require__ @ react-bootstrap.js:30
exports.__esModule @ react-bootstrap.js:450
__webpack_require__ @ react-bootstrap.js:30
exports.__esModule @ react-bootstrap.js:62
__webpack_require__ @ react-bootstrap.js:30
exports.__esModule @ react-bootstrap.js:50
(anonymous) @ react-bootstrap.js:53
webpackUniversalModuleDefinition @ react-bootstrap.js:9
(anonymous) @ react-bootstrap.js:10
1:85 Uncaught ReferenceError: ReactBootstrap is not defined
at 1:85