Issues getting Offcanvas working with reactstrap - reactjs

I'm working with an old react app. I want to use the Offcanvas component that's in reactstrap but the version I'm on does that not that installed.
Since the app is rather old I tried to do a pass and update everything at once. This however broke the app. So to keep my sanity I'm trying to only update the reactstrap lib. I ran npm update reactstrap npm update bootstrap and npm update react-bootstrap but I'm still getting a warning "export 'Offcanvas' was not found in 'reactstrap'
I do not have that much experience when it comes to react so I'm struggling when it comes to updates and configurations. Any advice on this issues and a general way to debug this would be extremely welcomed.
Here's my package json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"#babel/plugin-proposal-class-properties": "^7.7.0",
"#babel/plugin-transform-runtime": "^7.17.0",
"#babel/preset-react": "^7.7.0",
"axios": "^0.19",
"bootstrap": "^4.3.1",
"cross-env": "^5.2.1",
"jquery": "^3.2",
"laravel-mix": "^4.1.4",
"lodash": "^4.17.15",
"popper.js": "^1.16.0",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"resolve-url-loader": "^2.3.1",
"sass": "^1.23.3",
"sass-loader": "^7.3.1"
},
"dependencies": {
"#babel/runtime": "^7.17.9",
"#fortawesome/fontawesome-svg-core": "^1.2.25",
"#fortawesome/free-solid-svg-icons": "^5.11.2",
"#fortawesome/react-fontawesome": "^0.1.7",
"#yaireo/tagify": "^4.8.1",
"datepicker": "0.0.0",
"query-string": "^6.9.0",
"react-autosuggest": "^9.4.3",
"react-bootstrap": "^2.0.0-rc.0",
"react-confirm-alert": "^2.4.1",
"react-draggable": "^3.3.2",
"react-router-dom": "^5.1.2",
"react-switch": "^5.0.1",
"react-table": "^7.7.0",
"react-tabs": "^3.0.0",
"reactstrap": "^8.1.1",
"recharts": "^1.8.5",
"styled-components": "^5.3.0"
}
}

You have to upgrade your react-bootstrap:
npm i react-bootstrap#latest

Related

CRA project node v14.17.0 - Loading PostCSS "postcss-preset-env" plugin failed: Cannot find module 'node:vm'

I'm getting the following error when trying to start a CRA project running with node 14.17.0 -> Loading PostCSS "postcss-preset-env" plugin failed: Cannot find module 'node:vm'
Compiled with problems:X
ERROR in ./src/app.css (./node_modules/css-loader/dist/cjs.js??ruleSet1.rules[0].oneOf[5].use1!./node_modules/postcss-loader/dist/cjs.js??ruleSet1.rules[0].oneOf[5].use[2]!./src/app.css)
Module Error (from ./node_modules/postcss-loader/dist/cjs.js):
Loading PostCSS "postcss-preset-env" plugin failed: Cannot find module 'node:vm'
Require stack:
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/#csstools/postcss-trigonometric-functions/dist/index.cjs
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/postcss-preset-env/dist/index.cjs
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/postcss-loader/dist/utils.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/postcss-loader/dist/index.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/postcss-loader/dist/cjs.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/loader-runner/lib/loadLoader.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/loader-runner/lib/LoaderRunner.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/webpack/lib/NormalModule.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/webpack-manifest-plugin/dist/index.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/react-scripts/config/webpack.config.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/react-app-rewired/overrides/webpack.js
/Users/niltonxd/Workspace/harv-Harvest-frontend/node_modules/react-app-rewired/scripts/start.js
(#/Users/niltonxd/Workspace/harv-Harvest-frontend/src/app.css)
{
"name": "harvest-front",
"version": "1.7.4",
"private": true,
"dependencies": {
"#ant-design/icons": "^4.7.0",
"#fortawesome/fontawesome-svg-core": "^1.2.22",
"#fortawesome/free-solid-svg-icons": "^5.10.2",
"#fortawesome/react-fontawesome": "^0.1.4",
"#types/jest": "^27.4.1",
"#types/node": "^17.0.23",
"#types/react": "^17.0.43",
"#types/react-dom": "^17.0.14",
"antd": "^4.18.7",
"apexcharts": "^3.19.2",
"apisauce": "^1.1.0",
"connected-react-router": "^6.5.2",
"dotenv": "^10.0.0",
"formik": "^2.2.9",
"har-validator": "^5.1.5",
"history": "4.10.1",
"js-file-download": "^0.4.9",
"leaflet": "^1.7.1",
"lodash": "^4.17.21",
"moment": "^2.22.2",
"moment-timezone": "^0.5.33",
"papaparse": "^5.2.0",
"password-validator": "^5.0.2",
"prop-types": "^15.6.2",
"query-string": "^6.8.3",
"react": "^17.0.2",
"react-apexcharts": "^1.3.7",
"react-clear-cache": "^1.2.0",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "npm:#hot-loader/react-dom#^17.0.2",
"react-error-boundary": "^3.1.4",
"react-intl": "^2.4.0",
"react-leaflet": "2.8.0",
"react-number-format": "^4.3.1",
"react-redux": "^7.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "5.0.1",
"recharts": "^1.0.1",
"redis": "^3.1.2",
"redux": "^4.0.1",
"redux-persist": "^6.0.0",
"redux-saga": "^1.0.2",
"source-map-explorer": "^2.5.2",
"typescript": "^4.6.3",
"url-search-params": "^1.1.0",
"xlsx": "^0.16.4",
"yup": "^0.27.0"
},
"resolutions": {
"moment": "2.24.0",
"antd": "4.2.4",
"immer": "9.0.6",
"property-expr": "2.0.3",
"ansi-html": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz",
"glob-parent": "6.0.1",
"styled-components": "^5"
},
"scripts": {
"prebuild": "npm install react-dom#17.0.2 --save",
"sonar": "node sonar-project.js",
"start": "react-app-rewired start",
"start::dev": "env-cmd -e dev react-app-rewired start",
"start::qa": "env-cmd -e qa react-app-rewired start",
"start::np": "env-cmd -e np react-app-rewired start",
"build": "react-app-rewired --max-old-space-size=8192 build",
"test": "react-app-rewired test",
"test::ci": "react-app-rewired test --coverage=false --ci --watchAll=false --collectCoverageFrom=src/**/*.js --collectCoverageFrom=!src/assets/**/*.js",
"qa": "PORT=8081 react-scripts start",
"cy::op": "cypress open",
"cy::ru": "cypress run",
"lint": "eslint --max-warnings 0 --ignore-path .gitignore --fix --ext .js,.jsx,.ts,.tsx src",
"prettier": "prettier --ignore-path .gitignore \"**/*.+(js|json)\"",
"format": "yarn run prettier -- --write",
"check-format": "yarn run prettier -- --list-different",
"validate": "yarn run lint && yarn run test --watchAll --bail",
"createJob": "node ci/createJob.js",
"deleteJob": "node ci/deleteJob.js",
"checkEnvironment": "node ci/checkEnvironment.js",
"cm": "cz",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"generate:gc": "plop --plopfile ./generators/globalComponent.js"
},
"devDependencies": {
"#babel/plugin-proposal-class-properties": "^7.16.0",
"#babel/plugin-proposal-private-methods": "^7.14.5",
"#babel/plugin-proposal-private-property-in-object": "^7.15.4",
"#babel/preset-typescript": "^7.16.7",
"#commitlint/cli": "^16.0.2",
"#commitlint/config-conventional": "^16.0.0",
"#testing-library/cypress": "^8.0.1",
"#testing-library/dom": "^8.5.0",
"#testing-library/jest-dom": "^5.14.1",
"#testing-library/react": "^12.1.0",
"#testing-library/react-hooks": "^7.0.2",
"#testing-library/user-event": "^13.3.0",
"#types/lodash": "^4.14.182",
"#types/react-router-dom": "^5.3.3",
"#types/styled-components": "^5.1.24",
"#types/yup": "^0.29.13",
"#typescript-eslint/eslint-plugin": "^5.18.0",
"#typescript-eslint/parser": "^5.18.0",
"babel-eslint": "^10.1.0",
"babel-plugin-styled-components": "^2.0.6",
"commitizen": "^4.2.4",
"customize-cra": "^1.0.0",
"customize-cra-less-loader": "^2.0.0",
"cypress": "9.5.2",
"cypress-file-upload": "^5.0.8",
"cypress-mochawesome-reporter": "^2.3.0",
"cz-conventional-changelog": "^3.3.0",
"env-cmd": "^10.1.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-jest-dom": "^3.9.2",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.29.3",
"eslint-plugin-sonarjs": "^0.6.0",
"eslint-plugin-testing-library": "^4.12.2",
"husky": "^4.2.3",
"jest-axe": "^5.0.1",
"jest-styled-components": "^7.0.8",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"less-vars-to-js": "^1.3.0",
"lint-staged": "^11.1.2",
"plop": "^3.0.5",
"postcss-normalize": "^10.0.1",
"prettier": "^2.3.0",
"react-app-rewired": "^2.1.8",
"react-extras": "^3.0.0",
"react-ga": "^3.3.0",
"react-hot-loader": "^4.13.0",
"reactotron-apisauce": "^3.0.0",
"reactotron-react-js": "^3.3.2",
"reactotron-redux": "^3.1.1",
"reactotron-redux-saga": "^4.2.2",
"resolve-url-loader": "^3.1.2",
"sonarqube-scanner": "^2.8.0",
"styled-components": "^5.3.5"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"jest": {
"moduleDirectories": [
"node_modules",
"src"
],
"moduleNameMapper": {
"#components/(.*)": "<rootDir>/./src/components/$1",
"#util/(.*)": "<rootDir>/./src/util/$1",
"#hooks/(.*)": "<rootDir>/./src/hooks/$1",
"#constants/(.*)": "<rootDir>/./src/constants/$1",
"#containers/(.*)": "<rootDir>/./src/containers/$1",
"#routes/(.*)": "<rootDir>/./src/routes/$1",
"#appRedux/(.*)": "<rootDir>/./src/appRedux/$1"
}
}
}
As it appears this error will temporarily get fixed by installing the latest version of Node.js.
So to fix this follow these steps:
Download and install the latest Node.js version (recommended for most users, which is 16.15.0 at this moment).
Delete your node_modules directory from your project. Then you can optionally clear npm cache with npm cache clean and verify it with npm cache verify.
Delete package-lock.json/yarn.lock file.
Reinstall all of the dependencies and create a new dependency tree using one of the following commands: npm i/npm install/yarn/yarn install.
Note1: If in any case, you use node-sass in React projects yet, it is recommended to use sass instead.
Note2: In some cases skipping step 1 will also work as expected, but I recommend upgrading the Node.js version if you do not have other dependencies to prevent that.
Note3: As #IvaniltonBezerra mentions in the comments, some app builds may throw errors, since upgrading Node.js to its latest version will upgrade the npm as well it may not compatible with your current dependency tree in production, so to prevent such a problem you have to use --legacy-peer-deps to restore the old behaviour of the old dependencies.
Update
This is now seem to be permanently solved in PostCSS Preset Env and following the above steps with skipping step 1 will also solve the problem.
You're most likely trying to use create-react-app inside of an image, and the image's current Node version/configurations are crossing wires with create-react-app; that's what I just did by mistake using Docker, and I got the same exact compiling error with node:vm as a missing module
If you're using create-react-app, don't use it while you're in any Docker/Dev Environment images, just run the npx command in your terminal as is (probably helps having node downloaded on your local machine as well)
npx create-react-app my-app --template typescript
Hopefully that helps, I know that solved my problem
I had the same issue. I am using macOS, so some of the commands below are not applicable if we are using Windows or Linux.
I did the following steps to fix the issue:
Remove node_modules and clear the npm cache
rm -f -r node_modules && npm cache verify
Install the current latest node version (16.15.0)
// if you are using nvm to manage the node versioning
nvm install 16.15.0
nvm use 16.15.0
We can access here if we are using N, homebrew or MacPorts
Reinstall the project packages
npm i

Why Changes are not reflecting in React native?

I am changing something in .js file for ex. any text for textfiled placeholder. But after running command react-native run-android nothing is changing in android emulator. only when i run npm run bundle-android and then run react-native run-android changes are reflecting.
My package.json is like
{
"name": "xyz",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"bundle-android": "react-native bundle --entry-file index.js --platform android --dev false --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res/",
"bundle-ios": "react-native bundle --entry-file index.js --bundle-output ./ios/bundle/index.ios.jsbundle --platform ios --assets-dest ./ios/bundle --dev false",
"test": "jest",
"ios": "react-native run-ios --simulator 'iPhone X'",
"android": "react-native run-android -- --reset-cache",
"android-ete": "ENVFILE=.env.ete react-native run-android -- --reset-cache",
"ios-ete": "ENVFILE=.env.ete react-native run-ios",
"ios-prod": "ENVFILE=.env.prod react-native run-ios",
"exportcert-ete": "java -jar BKSPubKeyTool.jar --importkeystore keystore_ete.bks --alias oauth.testing --password keystorepwd --exportcert src/keystore/id_rsa_ete.pem --exportjs src/keystore/pubKey_ete.js",
"exportcert-prod": "java -jar BKSPubKeyTool.jar --importkeystore keystore.bks --alias oauth --password keystorepwd --exportcert src/keystore/id_rsa_prod.pem --exportjs src/keystore/pubKey_prod.js",
"lint": "eslint ."
},
"dependencies": {
"axios": "^0.19.0",
"buffer": "^5.2.1",
"crypto-js": "^3.1.9-1",
"jetifier": "^1.6.3",
"jsencrypt": "^3.0.0-rc.1",
"mobx": "^5.11.0",
"mobx-react": "^5.4.4",
"moment": "^2.24.0",
"native-base": "^2.12.1",
"prop-types": "^15.7.2",
"querystring": "^0.2.0",
"react": "16.8.6",
"react-native": "0.60.3",
"react-native-config": "^0.11.7",
"react-native-date-picker": "^2.7.3",
"react-native-device-info": "2.3.2",
"react-native-exception-handler": "^2.10.8",
"react-native-gesture-handler": "^1.4.0",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-linear-gradient": "^2.5.4",
"react-native-modal": "^11.1.0",
"react-native-modal-dropdown": "^0.6.2",
"react-native-picker-select": "^6.3.0",
"react-native-popup-dialog": "^0.18.2",
"react-native-reanimated": "^1.4.0",
"react-native-root-toast": "^3.1.2",
"react-native-screens": "^2.0.0-beta.10",
"react-native-scrollable-tab-view": "^0.10.0",
"react-native-splash-screen": "^3.2.0",
"react-native-sqlite-storage": "^3.3.11",
"react-native-tab-view": "^2.8.0",
"react-native-user-agent": "^1.0.4",
"react-native-user-inactivity": "^1.0.1",
"react-native-uuid": "^1.4.9",
"react-native-wheel-picker-android": "^2.0.5",
"react-navigation": "^3.11.1"
},
"devDependencies": {
"#babel/core": "^7.5.5",
"#babel/plugin-proposal-decorators": "^7.4.4",
"#babel/runtime": "^7.5.5",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.8.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-react-native": "^4.0.1",
"eslint": "^6.1.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.55.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}
As i am new to react native please let me know if more information needed in question?
Thank you for help
Sometimes it can load an old version of the code and not updating.
For me sometimes just \android\gradlew clean and react-native run-android (from the main folder) works.
I don't know if it solves your problem but it worth a try. A lot of errors in react-native can be solved by gradlew clean and/or restarting your computer.
You need to compile the code first..
npm run dev
Or
npm test

how to check dependency versions in expo react

I am using expo, react native and react together with react native web. I am upgrading to expo#32 and thus react-native#57.1
I am running everything great on phone however not on web. with a dependency error often displayed:
ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module '../Components/AccessibilityInfo/AccessibilityInfo' (While processing preset: "/Users/jeremie/piple/piple/node_modules/react-native/Libraries/react-native/react-native-implementation.js")
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.get AccessibilityInfo [as AccessibilityInfo] (/Users/jeremie/piple/piple/node_modules/react-native/Libraries/react-native/react-native-implementation.js:19:12)
at /Users/jeremie/piple/piple/node_modules/lodash/_baseClone.js:163:23
at arrayEach (/Users/jeremie/piple/piple/node_modules/lodash/_arrayEach.js:15:9)
at baseClone (/Users/jeremie/piple/piple/node_modules/lodash/_baseClone.js:160:3)
at cloneDeepWith (/Users/jeremie/piple/piple/node_modules/lodash/cloneDeepWith.js:37:10)
at OptionManager.mergeOptions (/Users/jeremie/piple/piple/node_modules/babel-core/lib/transformation/file/options/option-manager.js:206:44)
# multi (webpack)-dev-server/client?http://localhost:8080 (webpack)/hot/dev-server.js ./src/index.js main[2]
I need to make sure that all my packages versions are compatible. I have looked at the changelog of react native and expo and updated everything as it should..
I don't get how to inspect more and how to debug my error.
Here is my package.json
"name": "piple",
"version": "0.7",
"private": true,
"devDependencies": {
"babel-loader": "^7.1.2",
"babel-plugin-expo-web": "^0.0.5",
"babel-plugin-react-native-web": "^0.10.0",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-imports": "1.4.1",
"babel-plugin-transform-runtime": "6.23.0",
"css-loader": "0.28.7",
"docz": "^0.12.16",
"eslint-plugin-react": "^7.10.0",
"file-loader": "^1.1.7",
"gh-pages": "^1.2.0",
"jest-expo": "^32.0.0",
"react-native-scripts": "^2.0.1",
"react-styleguidist": "^8.0.6",
"react-test-renderer": "16.6.3",
"style-loader": "^0.19.0",
"sw-precache-webpack-plugin": "^0.11.5",
"webpack-cli": "^3.1.2",
"webpack-manifest-plugin": "^2.0.4"
},
"main": "./node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"eject": "expo eject",
"android": "expo start --android",
"ios": "expo start --ios",
"test": "NODE_ENV=test node_modules/.bin/jest",
"test:ci": "jest --ci",
"clean": "rm -rf node_modules && yarn cache clean && npm cache clean --force",
"make": "yarn",
"deploy:full": "./deploy",
"deploy:fast": "yarn build:prod && expo publish && git add -A && git commit -m 'new version of PiPle keep looking on our develop branch' && git push && git checkout master && git merge --no-edit devellop && git push && git checkout devellop",
"docu:dev": "docz dev",
"docu:build": "docz build",
"web": "webpack-dev-server -d --config ./webpack.config.js --env dev --inline --hot --colors --content-base app/ --history-api-fallback",
"build:dev": "NODE_ENV=production webpack --env dev --config ./webpack.config.js",
"build:prod": "NODE_ENV=production webpack --env prod --config ./webpack.config.js"
},
"jest": {
"transformIgnorePatterns": [
"node_module/(?!(jest-)?react-native|react-navigation)"
],
"moduleDirectories": [
"node_modules"
],
"preset": [
"jest-expo"
]
},
"dependencies": {
"#sentry/browser": "^4.4.1",
"#sentry/cli": "^1.31.0",
"audit": "0.0.6",
"babel-plugin-transform-remove-console": "^6.9.4",
"es6-symbol": "^3.1.1",
"expo": "^32.0.0",
"expo-analytics": "^1.0.7",
"expo-firebase-crashlytics": "^1.0.0",
"expo-web": "^0.0.14",
"firebase": "^5.0.3",
"get-urls": "^8.0.0",
"javascript-time-ago": "^1.0.34",
"jsc-android": "^224109.1.0",
"lodash": "^4.15.0",
"mobx": "^4",
"mobx-react": "5.1.0",
"npm": "^6.5.0",
"open-graph-scraper": "^3.6.0",
"password-validator": "^4.1.1",
"prop-types": "^15.6.2",
"query-string": "^6.2.0",
"react": "^16.6.3",
"react-art": "^16.5.1",
"react-css-blur": "^1.1.1",
"react-dom": "^16.5.1",
"react-markdown": "^4.0.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-native-blur": "^3.2.2",
"react-native-camera-roll-picker": "^1.2.3",
"react-native-dialog": "^5.4.0",
"react-native-simple-markdown": "^1.1.0",
"react-native-web": "^0.10.0",
"react-native-web-svg": "^1.0.0",
"react-navigation": "^3.0.9",
"sentry-expo": "^1.11.0",
"simple-markdown": "git://github.com/CharlesMangwa/simple-markdown.git",
"sweetalert": "^2.1.2",
"uglifyjs-webpack-plugin": "^1",
"webpack": "^4.0.0",
"webpack-dev-server": "^3.1.10",
"ws": "^6.0.0"
}
}
When you call npx expo or npx expo start it should also validate all dependencies, and if there are some problems it writes something like:
Also, npx expo-cli doctor can help by providing additional info.

Heroku is deploying old react?

Im using laravel framework (as rest api) and reactjs (to render views). I did a lot of changes to my code (local) and then pushed it on github and deploy on heroku. I noticed that react app is rendering old code version when laravel api works fine (i can use routes which i added). Why react didnt update?
package.json:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {},
"dependencies": {
"axios": "^0.18",
"babel-preset-react": "^6.23.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^2.0",
"lodash": "^4.17.4",
"popper.js": "^1.12",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"gh-pages": "^2.0.1",
"react-icons": "^3.2.2",
"react-redux": "^5.0.7",
"react-scripts": "1.1.5",
"redux": "^4.0.0",
"styled-components": "^4.0.2",
"react-router-dom": "^4.3.1",
"redux-thunk": "^2.3.0"
}
}
May be the problem with your browser cache. Not in heroku. Please clear your browser cache and open your app again
Okay i figured it out! I need to render project on localhost to regenerate app.js in public/js before deploy on heroku -_-'

Update webpack-dev-server laravel

Im using laravel with React and I am getting some security issues. According to This post. I will need to upgradee my webpack-dev-server. Current my package.json file looks like
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"babel-preset-react": "^6.23.0",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^2.0",
"lodash": "^4.17.11",
"popper.js": "^1.12",
"react": "^16.2.0",
"react-dom": "^16.2.0"
},
"dependencies": {
"#material-ui/core": "^3.3.2",
"#material-ui/icons": "^3.0.1",
"classnames": "^2.2.6",
"gulp": "^4.0.0",
"moment": "^2.22.2",
"react-datetime": "^2.16.2",
"react-google-maps": "^9.4.5",
"react-loading": "^2.0.3",
"react-modal": "^3.6.1",
"react-places-autocomplete": "^7.2.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"recompose": "^0.30.0",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"throttle-debounce": "^2.0.1",
"underscore": "^1.9.1",
"validator": "^10.8.0"
}
}
And my package-lock.json file has some mention about my webpack-dev-server version being
"version": "2.11.3"
What is the correct procedure to upgrade my webpack to a non-vulnerable version?

Resources