Upgrading react-scripts to 4.x.x breaks my app - reactjs

I have been developing a frontend app using React (v16.44.0, cannot upgrade to v17 yet due to a dependency), react-scripts v3.4.4, Typescript (v3.9.9) and React-Bootstrap (v1.5.1) for a few months and all is going well.
However, react-scripts have been updated recently to a v4, and upgrading breaks the whole app. I am concerned with securities issues with react-scripts v3. I also would like to upgrade Typescript to v4+, there seem to be an incompatibility btw Typescript 4 and react-scripts 3 related to eslint. Various deprecation warnings are also stacking up.
When I enable react-scripts v4.0.3, run npm start to launch the development server, Firefox (v78.8) throws:
"ReferenceError: SharedArrayBuffer is not defined" in "node_modules/webidl-conversions/lib/index.js:347".
Apparently webidl-conversions is required by bootstrap. I have searched about the SharedArrayBuffer issue, apparently it requires enabling additional headers, but I could not find how to add them using the npm start webserver.
[Edit: upgraded Firefox to v86, still have the issue but I have not tried to configure it yet.]
If I try with Chrome (v89), I have:
"TypeError: Cannot convert undefined or null to object" on "node_modules/whatwg-url/dist/utils.js:48"
which also seem to be required by Bootstrap.
I do not have a dependency on Bootstrap per se, I use the react-bootstrap implementation. However, I use bootstrap-scss for the (S)CSS part.
I can upload full stack traces if needed. Here is my package.json:
{
"name": "ab-concept-backoffice",
"version": "42.0.0",
"private": true,
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^1.2.34",
"#fortawesome/free-regular-svg-icons": "^5.15.2",
"#fortawesome/free-solid-svg-icons": "^5.15.2",
"#fortawesome/react-fontawesome": "^0.1.14",
"bootstrap-scss": "^4.6.0",
"classnames": "^2.2.6",
"date-fns": "^2.17.0",
"filesize": "^6.1.0",
"flux": "^4.0.1",
"immutable": "^4.0.0-rc.12",
"jsdom": "^16.5.1",
"lz-string": "^1.4.4",
"monet": "^0.9.1",
"query-string": "^6.14.0",
"react": "^16.14.0",
"react-autosuggest": "^10.1.0",
"react-bootstrap": "^1.5.1",
"react-color": "^2.19.3",
"react-cookie": "^4.0.3",
"react-day-picker": "^7.4.8",
"react-dom": "^16.14.0",
"react-gravatar": "^2.6.3",
"react-html5-camera-photo": "^1.5.4",
"react-number-format": "^4.4.4",
"react-phone-number-input": "^3.1.16",
"react-process-string": "^1.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"react-select": "^4.1.0",
"react-sketch": "^0.5.1",
"react-three-state-checkbox": "^1.3.4"
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "react-scripts start",
"build": "npm version patch && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app"
]
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"#types/classnames": "^2.2.11",
"#types/humanize-duration": "^3.18.0",
"#types/lz-string": "^1.3.34",
"#types/md5": "^2.3.0",
"#types/node": "^14.14.31",
"#types/react": "^17.0.2",
"#types/react-autosuggest": "^10.1.2",
"#types/react-color": "^3.0.4",
"#types/react-gravatar": "^2.6.8",
"#types/react-phone-number-input": "^3.0.6",
"#types/react-router-dom": "^5.1.7",
"#types/react-select": "^4.0.13",
"sass": "^1.32.8",
"typescript": "^4.2.3"
}
}
Firefox stack trace:
ReferenceError: SharedArrayBuffer is not defined
./node_modules/webidl-conversions/lib/index.js
node_modules/webidl-conversions/lib/index.js:347
344 |
345 | const abByteLengthGetter =
346 | Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
> 347 | const sabByteLengthGetter =
348 | Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get;
349 |
350 | function isNonSharedArrayBuffer(V) {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
./node_modules/whatwg-url/dist/URL.js
node_modules/whatwg-url/dist/URL.js:3
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
./node_modules/whatwg-url/webidl2js-wrapper.js
node_modules/whatwg-url/webidl2js-wrapper.js:3
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
./node_modules/whatwg-url/index.js
node_modules/whatwg-url/index.js:3
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
1
http://localhost:3000/static/js/main.chunk.js:39420:18
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
checkDeferredModules
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
> 45 | result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
| ^ 46 | }
47 | }
48 |
webpackJsonpCallback
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
> 32 | return checkDeferredModules();
| ^ 33 | };
34 | function checkDeferredModules() {
35 | var result;
(anonymous function)
http://localhost:3000/static/js/main.chunk.js:1:95
Chrome stack trace:
TypeError: Cannot convert undefined or null to object
./node_modules/whatwg-url/dist/utils.js
node_modules/whatwg-url/dist/utils.js:48
45 |
46 | const iterInternalSymbol = Symbol("internal");
47 | const IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
> 48 | const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype);
49 |
50 | function isArrayIndexPropName(P) {
51 | if (typeof P !== "string") {
View compiled
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
./node_modules/whatwg-url/dist/URL.js
node_modules/whatwg-url/dist/URL.js:4
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
./node_modules/whatwg-url/webidl2js-wrapper.js
node_modules/whatwg-url/webidl2js-wrapper.js:3
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
./node_modules/whatwg-url/index.js
node_modules/whatwg-url/index.js:3
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
1
http://localhost:3000/static/js/main.chunk.js:39420:18
__webpack_require__
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
checkDeferredModules
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
> 45 | result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
| ^ 46 | }
47 | }
48 |
View compiled
Array.webpackJsonpCallback [as push]
/home/vion/workspace/ab-concept-frontend/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
> 32 | return checkDeferredModules();
| ^ 33 | };
34 | function checkDeferredModules() {
35 | var result;
View compiled
(anonymous function)
http://localhost:3000/static/js/main.chunk.js:1:95

It's hard to tell exactly without your full package.json, but it seems that it's not related to the update of react-scripts itself, but instead probably an updgrade on another library that you are depending on that uses SharedArrayBuffer which is not supported in Firefox v78
Edit: OP found out that the problematic package was react-sketch
As per the other error, it seems to be related, but don't know exactly why it happens. Anyhow, found this issue in their Github page and one suggestion is to upgrade jsdom to version >=16.3 (if you are using it)

Did you apply each migration described in the changelog?
They also suggest you delete node_modules if you break your app when updating from 3.4 to 4.
NOTE: You may need to delete your node_modules folder and reinstall your dependencies by running yarn (or npm install) if you encounter errors after upgrading.
Try deleting it and running npm install

You can download Bootstrap CSS files manually and save them in project files.

Try:
Deleting your node_modules and package-lock.json
// This normally fixes my issue when going back to old react projects
npm cache clean --force
run npm install
run npm run start

Related

React + FontAwesome + Bootstrap

I am attempting to learn React and Bootstrap at the same time. I am a beginner.
My issue is that I am trying to display a FontAwesome icon within a React application using the FontAwesome component. I have a Pro license for FontAwesome and have followed their directions on setting up the dependencies. My package.json contains the following:
"dependencies": {
"#fortawesome/fontawesome-pro": "^5.15.4",
"#fortawesome/fontawesome-svg-core": "^1.2.33-beta1",
"#fortawesome/pro-regular-svg-icons": "^6.0.0-beta1",
"#fortawesome/react-fontawesome": "^0.1.15",
"#testing-library/jest-dom": "^5.14.1",
"#testing-library/react": "^11.2.7",
"#testing-library/user-event": "^12.8.3",
"bootstrap": "^5.1.1",
"react": "^17.0.2",
"react-bootstrap": "^1.6.3",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.2"
},
When I attempt to use an icon in a component like below:
import { FontAwesomeIcon } from "#fortawesome/react-fontawesome";
import { faUser } from "#fortawesome/pro-regular-svg-icons";
function Header(){
return (
<header>
<h1>My Header</h1>
<FontAwesomeIcon icon={faUser} color="red" size="6x" />
</header>
)
}
export default Header
I get an error:
Error: Cannot find module '#fortawesome/free-solid-svg-icons'
When I review the error bodies below the header they all seem to point to bootstrap.
__webpack_require__
C:/work/RTS/rts_react/webpack/bootstrap:851
848 |
849 | __webpack_require__.$Refresh$.init();
850 | try {
> 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 852 | } finally {
853 | __webpack_require__.$Refresh$.cleanup(moduleId);
854 | }
View compiled
fn
C:/work/RTS/rts_react/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
C:/work/RTS/rts_react/webpack/bootstrap:851
848 |
849 | __webpack_require__.$Refresh$.init();
850 | try {
> 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 852 | } finally {
853 | __webpack_require__.$Refresh$.cleanup(moduleId);
854 | }
View compiled
fn
C:/work/RTS/rts_react/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
C:/work/RTS/rts_react/webpack/bootstrap:851
848 |
849 | __webpack_require__.$Refresh$.init();
850 | try {
> 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 852 | } finally {
853 | __webpack_require__.$Refresh$.cleanup(moduleId);
854 | }
View compiled
fn
C:/work/RTS/rts_react/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
C:/work/RTS/rts_react/webpack/bootstrap:851
848 |
849 | __webpack_require__.$Refresh$.init();
850 | try {
> 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 852 | } finally {
853 | __webpack_require__.$Refresh$.cleanup(moduleId);
854 | }
View compiled
fn
C:/work/RTS/rts_react/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
1
http://localhost:3000/static/js/main.chunk.js:1069:18
__webpack_require__
C:/work/RTS/rts_react/webpack/bootstrap:851
848 |
849 | __webpack_require__.$Refresh$.init();
850 | try {
> 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 852 | } finally {
853 | __webpack_require__.$Refresh$.cleanup(moduleId);
854 | }
View compiled
checkDeferredModules
C:/work/RTS/rts_react/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
> 45 | result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
| ^ 46 | }
47 | }
48 |
View compiled
Array.webpackJsonpCallback [as push]
C:/work/RTS/rts_react/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
> 32 | return checkDeferredModules();
| ^ 33 | };
34 | function checkDeferredModules() {
35 | var result;
I have looked through my project which is still small because I am just beginning and I can't find any reference to the Free icons for FontAwesome. I am at a loss and not sure what to even ask. Is there a reference to the free icons within the Bootstrap React component?
According to FontAwesome's React documentation, you need to install #fortawesome/free-solid-svg-icons, too, before adding additional styles.
Run npm i --save #fortawesome/free-solid-svg-icons and try again.

TypeError: render is not a function while using React Context along with React Router

I need to set up a user state that can be called from different components. This setup uses React Router and React Context.
The React context contains just a single state that keeps track of the user's name.
At the top-level i.e App I have passed all the children on to the provider. But I get an error
TypeError: render is not a function
My UserContext code:
const UserContext = createContext();
export const UserProvider = (props) => {
const [user, setUser] = useState("");
return (
<UserContext.Provider value={[user, setUser]}>
{props.children}
</UserContext.Provider>
);
};
export default UserContext;
My App code :
function App() {
return (
<UserProvider>
<Router>
<div>
<Nav />
<Switch>
<Route exact path="/" component={Signup} />
<Route exact path="/signin" component={SignIn} />
<Route path="/register" component={UserRegister} />
<Route path="/homepage/:user" component={Homepage} />
</Switch>
</div>
</Router>
</UserProvider>
);
}
export default App;
The entrie error log:
TypeError: render is not a function
updateContextConsumer
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:18747
18744 | {
18745 | ReactCurrentOwner$1.current = workInProgress;
18746 | setIsRendering(true);
> 18747 | newChildren = render(newValue);
| ^ 18748 | setIsRendering(false);
18749 | } // React DevTools reads this flag.
18750 |
View compiled
beginWork
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:19114
19111 | return updateContextProvider(current, workInProgress, renderLanes);
19112 |
19113 | case ContextConsumer:
> 19114 | return updateContextConsumer(current, workInProgress, renderLanes);
| ^ 19115 |
19116 | case MemoComponent:
19117 | {
View compiled
HTMLUnknownElement.callCallback
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:3945
3942 | function callCallback() {
3943 | didCall = true;
3944 | restoreAfterDispatch();
> 3945 | func.apply(context, funcArgs);
| ^ 3946 | didError = false;
3947 | } // Create a global error event handler. We use this to capture the value
3948 | // that was thrown. It's possible that this error handler will fire more
View compiled
invokeGuardedCallbackDev
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:3994
3991 | // errors, it will trigger our global error handler.
3992 |
3993 | evt.initEvent(evtType, false, false);
> 3994 | fakeNode.dispatchEvent(evt);
| ^ 3995 |
3996 | if (windowEventDescriptor) {
3997 | Object.defineProperty(window, 'event', windowEventDescriptor);
View compiled
invokeGuardedCallback
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:4056
4053 | function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
4054 | hasError = false;
4055 | caughtError = null;
> 4056 | invokeGuardedCallbackImpl$1.apply(reporter, arguments);
4057 | }
4058 | /**
4059 | * Same as invokeGuardedCallback, but instead of returning an error, it stores
View compiled
beginWork$1
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:23964
23961 | } // Run beginWork again.
23962 |
23963 |
> 23964 | invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes);
| ^ 23965 |
23966 | if (hasCaughtError()) {
23967 | var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
View compiled
performUnitOfWork
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:22776
22773 |
22774 | if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
22775 | startProfilerTimer(unitOfWork);
> 22776 | next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
| ^ 22777 | stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
22778 | } else {
22779 | next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
View compiled
workLoopSync
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:22707
22704 | function workLoopSync() {
22705 | // Already timed out, so perform work without checking if we need to yield.
22706 | while (workInProgress !== null) {
> 22707 | performUnitOfWork(workInProgress);
22708 | }
22709 | }
22710 |
View compiled
renderRootSync
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:22670
22667 |
22668 | do {
22669 | try {
> 22670 | workLoopSync();
| ^ 22671 | break;
22672 | } catch (thrownValue) {
22673 | handleError(root, thrownValue);
View compiled
performSyncWorkOnRoot
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:22293
22290 | }
22291 | } else {
22292 | lanes = getNextLanes(root, NoLanes);
> 22293 | exitStatus = renderRootSync(root, lanes);
| ^ 22294 | }
22295 |
22296 | if (root.tag !== LegacyRoot && exitStatus === RootErrored) {
View compiled
scheduleUpdateOnFiber
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:21881
21878 | // root inside of batchedUpdates should be synchronous, but layout updates
21879 | // should be deferred until the end of the batch.
21880 |
> 21881 | performSyncWorkOnRoot(root);
| ^ 21882 | } else {
21883 | ensureRootIsScheduled(root, eventTime);
21884 | schedulePendingInteractions(root, lane);
View compiled
updateContainer
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:25482
25479 | }
25480 |
25481 | enqueueUpdate(current$1, update);
> 25482 | scheduleUpdateOnFiber(current$1, lane, eventTime);
25483 | return lane;
25484 | }
25485 | function getPublicRootInstance(container) {
View compiled
(anonymous function)
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:26021
26018 |
26019 |
26020 | unbatchedUpdates(function () {
> 26021 | updateContainer(children, fiberRoot, parentComponent, callback);
| ^ 26022 | });
26023 | } else {
26024 | fiberRoot = root._internalRoot;
View compiled
unbatchedUpdates
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:22431
22428 | executionContext |= LegacyUnbatchedContext;
22429 |
22430 | try {
> 22431 | return fn(a);
| ^ 22432 | } finally {
22433 | executionContext = prevExecutionContext;
22434 |
View compiled
legacyRenderSubtreeIntoContainer
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:26020
26017 | } // Initial mount should not be batched.
26018 |
26019 |
> 26020 | unbatchedUpdates(function () {
| ^ 26021 | updateContainer(children, fiberRoot, parentComponent, callback);
26022 | });
26023 | } else {
View compiled
render
G:/WebDevelopmentFolder/trinkerrchallenge/node_modules/react-dom/cjs/react-dom.development.js:26103
26100 | }
26101 | }
26102 |
> 26103 | return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
26104 | }
26105 | function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
26106 | if (!isValidContainer(containerNode)) {
View compiled
Module.<anonymous>
G:/WebDevelopmentFolder/trinkerrchallenge/src/index.js:6
3 | import "./index.css";
4 | import App from "./App";
5 |
> 6 | ReactDOM.render(
7 | <React.StrictMode>
8 | <App />
9 | </React.StrictMode>,
View compiled
Module../src/index.js
http://localhost:3000/static/js/main.chunk.js:1581:30
__webpack_require__
G:/WebDevelopmentFolder/trinkerrchallenge/webpack/bootstrap:851
848 |
849 | __webpack_require__.$Refresh$.init();
850 | try {
> 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 852 | } finally {
853 | __webpack_require__.$Refresh$.cleanup(moduleId);
854 | }
View compiled
fn
G:/WebDevelopmentFolder/trinkerrchallenge/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
1
http://localhost:3000/static/js/main.chunk.js:1595:18
__webpack_require__
G:/WebDevelopmentFolder/trinkerrchallenge/webpack/bootstrap:851
848 |
849 | __webpack_require__.$Refresh$.init();
850 | try {
> 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 852 | } finally {
853 | __webpack_require__.$Refresh$.cleanup(moduleId);
854 | }
View compiled
checkDeferredModules
G:/WebDevelopmentFolder/trinkerrchallenge/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
> 45 | result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
| ^ 46 | }
47 | }
48 |
View compiled
Array.webpackJsonpCallback [as push]
G:/WebDevelopmentFolder/trinkerrchallenge/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
> 32 | return checkDeferredModules();
| ^ 33 | };
34 | function checkDeferredModules() {
35 | var result;

received Error: failed to invert matrix when add in deckGL in Reactjs hooks

im new in reactjs and deckGL and im having a little problem with the code below. I am trying to add DeckGL with FlyToInterpolator to center the marker. I'm receiving this error after I clicked the button, but when i'm using the react-map-gl + FlyToInterpolator it works.
update: the issue is, I having a problem when using FlyToInterpolar API in deckGL, but I have no issue using FlyToInterpolar in react-map-gl.
Please help! thank you very much
p/s: sorry english is not my main language.
error:
Error: failed to invert matrix
▶ 3 stack frames were collapsed.
Mapbox._updateMapViewport
src/mapbox/mapbox.js:434
431 | newViewState.altitude !== oldViewState.altitude;
432 |
433 | if (viewportChanged) {
> 434 | this._map.jumpTo(this._viewStateToMapboxProps(newViewState));
| ^ 435 |
436 | // TODO - jumpTo doesn't handle altitude
437 | if (newViewState.altitude !== oldViewState.altitude) {
View compiled
Mapbox._update
src/mapbox/mapbox.js:400
397 | newProps = Object.assign({}, this.props, newProps);
398 | checkPropTypes(newProps, 'Mapbox');
399 |
> 400 | const viewportChanged = this._updateMapViewport(oldProps, newProps);
| ^ 401 | const sizeChanged = this._updateMapSize(oldProps, newProps);
402 |
403 | if (!newProps.asyncRender && (viewportChanged || sizeChanged)) {
View compiled
Mapbox.setProps
src/mapbox/mapbox.js:213
210 | }
211 |
212 | setProps(props: Props) {
> 213 | this._update(this.props, props);
| ^ 214 | return this;
215 | }
216 |
View compiled
StaticMap._updateMapProps
src/components/static-map.js:213
210 | if (!this._mapbox) {
211 | return;
212 | }
> 213 | this._mapbox.setProps(
| ^ 214 | Object.assign({}, props, {
215 | width: this._width,
216 | height: this._height
View compiled
StaticMap.componentDidUpdate
src/components/static-map.js:152
149 | componentDidUpdate(prevProps: StaticMapProps) {
150 | if (this._mapbox) {
151 | this._updateMapStyle(prevProps, this.props);
> 152 | this._updateMapProps(this.props);
| ^ 153 | }
154 | }
155 |
View compiled
▶ 19 stack frames were collapsed.
DeckGL._customRender
src/deckgl.js:148
145 | // Viewports have changed, update children props first.
146 | // This will delay the Deck canvas redraw till after React update (in componentDidUpdate)
147 | // so that the canvas does not get rendered before the child components update.
> 148 | this.forceUpdate();
| ^ 149 | } else {
150 | this._redrawDeck();
151 | }
View compiled
Deck.redraw
src/lib/deck.js:351
348 |
349 | this.stats.get('Redraw Count').incrementCount();
350 | if (this.props._customRender) {
> 351 | this.props._customRender(redrawReason);
| ^ 352 | } else {
353 | this._drawLayers(redrawReason);
354 | }
View compiled
Deck._onRenderFrame
src/lib/deck.js:707
704 | this._pickAndCallback();
705 |
706 | // Redraw if necessary
> 707 | this.redraw(false);
| ^ 708 |
709 | // Update viewport transition if needed
710 | // Note: this can trigger `onViewStateChange`, and affect layers
View compiled
AnimationLoop.onRender
src/lib/animation-loop.js:252
249 | }
250 |
251 | onRender(...args) {
> 252 | return this.props.onRender(...args);
| ^ 253 | }
254 |
255 | onFinalize(...args) {
View compiled
AnimationLoop._renderFrame
src/lib/animation-loop.js:340
337 | }
338 |
339 | // call callback
> 340 | this.onRender(...args);
| ^ 341 | // end callback
342 | }
343 |
View compiled
AnimationLoop.redraw
src/lib/animation-loop.js:178
175 | this._setupFrame();
176 | this._updateCallbackData();
177 |
> 178 | this._renderFrame(this.animationProps);
| ^ 179 |
180 | // clear needsRedraw flag
181 | this._clearNeedsRedraw();
View compiled
renderFrame
src/lib/animation-loop.js:279
276 | if (!this._running) {
277 | return;
278 | }
> 279 | this.redraw();
| ^ 280 | this._animationFrameId = this._requestAnimationFrame(renderFrame);
281 | };
282 |
View compiled
Code:
const MAPBOX_TOKEN = // Set your mapbox token here
const useStyles = makeStyles({
box: {
borderStyle: "solid",
position: "absolute",
top: 0,
right: 0,
left: 0,
bottom: 0,
zIndex: -1
},
})
const MapHooks = forwardRef((props, ref) => {
const [fleetDetail, setFleetDetail] = useState(null)
const [mapRef, setMapRef] = useState(null);
const classes = useStyles()
const sigfox = ApiSigfox()
const [mapping, setMapping] = useState({
width: '100%',
height: '100%',
longitude: -73.989308,
latitude: 40.741895,
zoom: 12
});
useImperativeHandle(ref, () => ({
_goToNYC(e) {
Object.values(sigfox).map((docs) => {
return (e === docs.device) ? (
updateMap(docs)
) : null
})
}
}));
//update Map
function updateMap(test){
console.log(test.device + '-' + 'updateMap')
const viewport = {
...mapping,
longitude: test.lon,
latitude: test.lat,
zoom: 14,
transitionDuration: 2000,
transitionInterpolator: new FlyToInterpolator(),
transitionEasing: d3.easeCubic
};
setMapping(viewport)
console.log(mapping)
}
return (
<div className={classes.box} style={{borderStyle: "solid"}}>
<DeckGL viewState={mapping} controller={true} onViewStateChange={setMapping}>
<StaticMap
mapStyle="mapbox://styles/mapbox/streets-v11"
mapboxApiAccessToken={MAPBOX_TOKEN}
>
{Object.values(sigfox).map((docs) => {
return (docs.status !== 255 && (docs.lat >= -90 && docs.lat <= 90) ) ?
<Marker
key={docs.id}
latitude={docs.lat}
longitude={docs.lon}
offsetTop={-35}
offsetLeft={-8}
>
<div>
<button onClick={e => {e.preventDefault(); setFleetDetail(docs)}}>{docs.device}</button>
</div>
</Marker>
: null
})}
{/* display the pop up detail when click the icon */}
{fleetDetail ? (
<Popup
latitude={fleetDetail.lat}
longitude={fleetDetail.lon}
onClose={()=>{
setFleetDetail(null)
}}
>
<div>
<p>Device:{fleetDetail.device}</p>
<p>Latitude:{fleetDetail.lat}</p>
<p>Longitude:{fleetDetail.lon}</p>
<p>status:{fleetDetail.status}</p>
</div>
</Popup>
): null}
</StaticMap>
</DeckGL>
</div>
);
})
Thank you very much :)

TypeError: Unable to set property 'props' of undefined or null reference [duplicate]

This question already has an answer here:
React-router: TypeError: Cannot set property 'props' of undefined
(1 answer)
Closed 3 years ago.
I m not able to figure out how to resolve this error previously it was not there.If m trying to make constructor.
Previously i have imported React twice
import React from 'react';
import React,{Component} from 'react';
because of which error was there. To correct it i have removed 1 import from the code.
import React,{Component} from 'react';
import './App.css';
class App extends Component() {
constructor(props){
}
render() {
return (
<div className="App">
<table className="titleBar">
<tbody>
<tr>
<td>
<img alt="app icon" width="50" src="primary_green.svg"/>
</td>
<td width="8"/>
<td>
<h1>MovieDb Search</h1>
</td>
</tr>
</tbody>
</table>
<input style={{
fontSize: 24,
display: 'block',
width: '99%',
paddingTop: 8,
paddingBottom: 8,
paddingLeft: 16
}} placeholder="Enter Search Term"/>
</div>
);
}
}
export default App;
×
TypeError: Unable to set property 'props' of undefined or null reference
Component
C:/Users/Admin/Desktop/React_Projects/movies_search/node_modules/react/cjs/react.development.js:298
295 | */
296 |
297 | function Component(props, context, updater) {
> 298 | this.props = props;
| ^
299 | this.context = context; // If a component has string refs, we will assign a different object later.
300 |
301 | this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
View compiled
./src/App.js
C:/Users/Admin/Desktop/React_Projects/movies_search/src/App.js:6
3 | import './App.css';
4 |
5 |
> 6 | class App extends Component() {
7 | constructor(props){
8 |
9 | }
View compiled
__webpack_require__
C:/Users/Admin/Desktop/React_Projects/movies_search/webpack/bootstrap:781
778 | };
779 |
780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^
782 |
783 | // Flag the module as loaded
784 | module.l = true;
View compiled
fn
C:/Users/Admin/Desktop/React_Projects/movies_search/webpack/bootstrap:149
146 | );
147 | hotCurrentParents = [];
148 | }
> 149 | return __webpack_require__(request);
| ^
150 | };
151 | var ObjectFactory = function ObjectFactory(name) {
152 | return {
View compiled
./src/index.js
http://localhost:3000/static/js/main.chunk.js:263:22
__webpack_require__
C:/Users/Admin/Desktop/React_Projects/movies_search/webpack/bootstrap:781
778 | };
779 |
780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^
782 |
783 | // Flag the module as loaded
784 | module.l = true;
View compiled
fn
C:/Users/Admin/Desktop/React_Projects/movies_search/webpack/bootstrap:149
146 | );
147 | hotCurrentParents = [];
148 | }
> 149 | return __webpack_require__(request);
| ^
150 | };
151 | var ObjectFactory = function ObjectFactory(name) {
152 | return {
View compiled
0
http://localhost:3000/static/js/main.chunk.js:390:1
__webpack_require__
C:/Users/Admin/Desktop/React_Projects/movies_search/webpack/bootstrap:781
778 | };
779 |
780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^
782 |
783 | // Flag the module as loaded
784 | module.l = true;
View compiled
checkDeferredModules
C:/Users/Admin/Desktop/React_Projects/movies_search/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
> 45 | result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
| ^
46 | }
47 | }
48 | return result;
View compiled
webpackJsonpCallback
C:/Users/Admin/Desktop/React_Projects/movies_search/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
> 32 | return checkDeferredModules();
| ^
33 | };
34 | function checkDeferredModules() {
35 | var result;
View compiled
Global code
http://localhost:3000/static/js/main.chunk.js:1:2
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.
When defining your App you are invoking Component as a function. Change
class App extends Component() {
to
class App extends Component {
Besides, it makes sense to remove the constructor if it is just empty.

Bug with react-accessible-accordion

Im using the following npm librarie :
"react-accessible-accordion": "2.3.1",
it is returning an error to me :
ReferenceError: babelHelpers is not defined
(anonymous function)
C:/Users/tabm005/www/node_modules/react-accessible-accordion/dist/umd/index.js:1037
1034 |
1035 | var createReactContext = unwrapExports(lib);
1036 |
> 1037 | var _typeof = typeof Symbol === "function" && babelHelpers.typeof(Symbol.iterator) === "symbol" ? function (obj) {
1038 | return typeof obj === 'undefined' ? 'undefined' : babelHelpers.typeof(obj);
1039 | } : function (obj) {
1040 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : babelHelpers.typeof(obj);
View compiled
./node_modules/react-accessible-accordion/dist/umd/index.js.React__default
http://localhost:3000/static/js/bundle.js:121672:10
121669 | /***/ (function(module, exports, __webpack_require__) {
121670 |
121671 | (function (global, factory) {
> 121672 | true ? factory(exports, __webpack_require__(/*! react */ "./node_modules/react/index.js")) :
| ^ 121673 | typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
121674 | (factory((global.reactAccessibleAccordion = {}),global.React));
121675 | }(this, (function (exports,React) { 'use strict';
View source
./node_modules/react-accessible-accordion/dist/umd/index.js
C:/Users/tabm005/www/node_modules/react-accessible-accordion/dist/umd/index.js:5
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
3 | typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
4 | (factory((global.reactAccessibleAccordion = {}),global.React));
> 5 | }(this, (function (exports,React) { 'use strict';
6 |
7 | var React__default = 'default' in React ? React['default'] : React;
8 |
View compiled
__webpack_require__
C:/Users/tabm005/www/webpack/bootstrap ad42cbaf3c46aaff76f3:678
675 | };
676 |
677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
679 |
680 | // Flag the module as loaded
681 | module.l = true;
View compiled
fn
C:/Users/tabm005/www/webpack/bootstrap ad42cbaf3c46aaff76f3:88
85 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
86 | hotCurrentParents = [];
87 | }
> 88 | return __webpack_require__(request);
89 | };
90 | var ObjectFactory = function ObjectFactory(name) {
91 | return {
View compiled
./src/components/Summary/summaryAccordion.js
http://localhost:3000/static/js/bundle.js:198742:85
__webpack_require__
C:/Users/tabm005/www/webpack/bootstrap ad42cbaf3c46aaff76f3:678
675 | };
676 |
677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
679 |
680 | // Flag the module as loaded
681 | module.l = true;
View compiled
fn
C:/Users/tabm005/www/webpack/bootstrap ad42cbaf3c46aaff76f3:88
85 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
86 | hotCurrentParents = [];
87 | }
> 88 | return __webpack_require__(request);
89 | };
90 | var ObjectFactory = function ObjectFactory(name) {
91 | return {
View compiled
./src/components/stepsFormsContainer/stepsFormsContainer.js
http://localhost:3000/static/js/bundle.js:206311:84
__webpack_require__
C:/Users/tabm005/www/webpack/bootstrap ad42cbaf3c46aaff76f3:678
675 | };
676 |
677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
679 |
680 | // Flag the module as loaded
681 | module.l = true;
View compiled
fn
C:/Users/tabm005/www/webpack/bootstrap ad42cbaf3c46aaff76f3:88
85 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
86 | hotCurrentParents = [];
87 | }
> 88 | return __webpack_require__(request);
89 | };
90 | var ObjectFactory = function ObjectFactory(name) {
91 | return {
View compiled
./src/components/stepsFormsContainer/index.js
C:/Users/tabm005/www/src/components/stepsFormsContainer/index.js:1
> 1 | import StepsFormsContainer from './stepsFormsContainer';
2 |
3 | export default StepsFormsContainer;
4 |
View compiled
▶ 5 stack frames were collapsed.
./src/components/stepperManager/index.js
C:/Users/tabm005/www/src/components/stepperManager/index.js:1
> 1 | import StepperManager from './stepperManager';
2 |
3 | export default StepperManager;
4 |
View compiled
▶ 12 stack frames were collapsed.
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.
I tried several manipulations : remove my node_modules and package-lock.json and re-install the application. I tried a newer version of accordion too and no solution worked for me.
Any Idea ?
I added the babel librairies and that resolved my problem:
"babel": "^6.23.0",
"babel-core": "^6.26.3"

Resources