I have been facing an unknown error after deploying on Heroku namely:
SyntaxError: Unexpected token '<'
However, deployment on GitHub pages works fine so I am unsure of the issue. Everything is working fine, except the actual page is just blank. When I view sources, it looks like this: Error
Here is my package.json file:
{
"version": "0.1.0",
"private": true,
"dependencies": {
"#emotion/react": "^11.8.2",
"#emotion/styled": "^11.8.1",
"#mui/icons-material": "^5.5.1",
"#mui/material": "^5.5.2",
"#mui/styled-engine-sc": "^5.5.2",
"#testing-library/jest-dom": "^5.16.1",
"#testing-library/react": "^12.1.2",
"#testing-library/user-event": "^13.5.0",
"autosuggest-highlight": "^3.2.1",
"axios": "^0.26.1",
"react": "^16.14.0",
"react-bootstrap": "^2.1.1",
"react-countup": "^6.1.1",
"react-dom": "^16.14.0",
"react-hook-form": "^7.29.0",
"react-icons": "^4.3.1",
"react-redux": "^7.2.8",
"react-reveal": "^1.2.2",
"react-router-dom": "^5.3.0",
"react-scripts": "^5.0.0",
"react-scroll": "^1.8.4",
"react-text-typist": "^1.0.9",
"react-typist": "^2.0.5",
"redux": "^4.1.2",
"styled-components": "^5.3.5",
"web-vitals": "^2.1.3"
},
"scripts": {
"start": "node --max_old_space_size=2560 node_modules/.bin/react-scripts start",
"build": "node --max_old_space_size=2560 node_modules/.bin/react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.2.3",
"sass": "^1.48.0"
}
}
Does anyone know what is the problem?
Related
I'm doing e-com project in react. But suddenly after some-time when started npm start in react it throws me an error like
Proxy error: Could not proxy request /api/v1/products?keyword=&page=1&price[gte]=0&price[lte]=25000&ratings[gte]=0 from localhost:3000 to http://192.168.0.8:4000.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ETIMEDOUT).
Proxy error: Could not proxy request /Roboto-Regular.ttf from localhost:3000 to http://192.168.0.8:4000.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ETIMEDOUT).
Proxy error: Could not proxy request /api/v1/me from localhost:3000 to http://192.168.0.8:4000.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ETIMEDOUT).
My package.json of react
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^4.12.4",
"#material-ui/icons": "^4.11.3",
"#material-ui/lab": "^4.0.0-alpha.61",
"#testing-library/jest-dom": "^5.16.5",
"#testing-library/react": "^13.3.0",
"#testing-library/user-event": "^13.5.0",
"axios": "^0.27.2",
"overlay-navbar": "^1.2.3",
"react": "^18.2.0",
"react-alert": "^7.0.3",
"react-alert-template-basic": "^1.0.2",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-icons": "^4.4.0",
"react-js-pagination": "^3.0.3",
"react-material-ui-carousel": "^2.3.11",
"react-rating-stars-component": "^2.2.0",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-scripts": "^4.0.3",
"react-toastify": "^9.0.3",
"redux": "^4.2.0",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.4.1",
"web-vitals": "^2.1.4",
"webfontloader": "^1.6.28"
},
"scripts": {
"start": "react-scripts start ",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://192.168.0.8:4000"
}
My package.json of backend(server)
{
"name": "e-com",
"version": "1.0.0",
"description": "",
"main": "backend/server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node backend/server.js",
"dev": "nodemon backend/server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.0",
"cloudinary": "^1.30.1",
"cookie-parser": "^1.4.6",
"dotenv": "^16.0.1",
"express": "^4.18.1",
"express-fileupload": "^1.4.0",
"jsonwebtoken": "^8.5.1",
"mongoose": "^6.5.2",
"nodemailer": "^6.7.8",
"nodemon": "^2.0.19",
"validator": "^13.7.0"
}
}
I tried several answers from stack-overflow like adding (a slash) "proxy": "http://192.168.0.8:4000/",
killing the tasks of node server in the task manager. Restarting the system again. Nothing worked!
All it changed to ECONNREFUSED --> ETIMEDOUT
Any help, please!
After a lot of countless searches. I forgot that, Ip address which I had given in the react package.json wasn't dynamic one. I'm finally able to do it. I just change my proxy to "proxy": "http://localhost:4000"
I'm getting errors in the app which I cannot help myself with fixing it. What might be the reason of 2 below errors? There are similar, the root-directory of them differs.
TypeError: C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\src\pages\cv-list\list\list.js: (0 , _genMapping.maybeAddMapping) is not a function
ERROR in ./src/pages/cv-list/list/list.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\src\pages\cv-list\list\list.js: (0 , _genMapping.maybeAddMapping) is not a function
at SourceMap.mark (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\source-map.js:49:37)
at Buffer._mark (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:142:60)
at Buffer._append (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:121:12)
at Buffer.append (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:82:10)
at Generator._append (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\printer.js:192:52)
at Generator.word (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\printer.js:100:10)
at Generator.VariableDeclaration (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\generators\statements.js:296:8)
at C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\printer.js:309:19
at Buffer.withSource (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:212:5)
Failed to compile.
TypeError: C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\src\pages\cv-list\list\list.js: (0 , _genMapping.maybeAddMapping) is not a function
ERROR in ./src/pages/cv-list/list/list.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\src\pages\cv-list\list\list.js: (0 , _genMapping.maybeAddMapping) is not a function
at SourceMap.mark (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\source-map.js:49:37)
at Buffer._mark (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:142:60)
at Buffer._append (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:121:12)
at Buffer.append (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:82:10)
at Generator._append (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\printer.js:192:52)
at Generator.word (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\printer.js:100:10)
at Generator.VariableDeclaration (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\generators\statements.js:296:8)
at C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\printer.js:309:19
at Buffer.withSource (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\buffer.js:212:5)
at Generator.withSource (C:\Users\marci\OneDrive\Pulpit\300B\BDB\bdb-front\node_modules\#babel\generator\lib\printer.js:176:15)
Just in case, here is my package.json
{
"name": "bdb-front",
"version": "0.1.0",
"private": true,
"dependencies": {
"#progress/kendo-date-math": "^1.5.7",
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/react": "^13.3.0",
"#testing-library/user-event": "^13.5.0",
"#types/jest": "^27.5.2",
"#types/node": "^16.11.39",
"#types/react": "^18.0.12",
"#types/react-dom": "^18.0.5",
"#types/styled-components": "^5.1.25",
"axios": "^0.27.2",
"eslint-config-airbnb": "^19.0.4",
"formik": "^2.2.9",
"js-joda": "^1.11.0",
"moment": "^2.29.4",
"primeflex": "^3.1.0",
"primeicons": "^5.0.0",
"primereact": "^8.1.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-export-excel": "^0.5.3",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1",
"react-transition-group": "^4.4.1",
"redux": "^4.2.0",
"sass": "^1.53.0",
"styled-components": "^5.3.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint src"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"node-sass": "^7.0.1",
"typescript": "^4.7.4"
}
}
it occurred when I started to work on react-export-table, my intention is to export data which is an array of objects into excel file. Below You can find the codesandbox which reflects the code I have in my app:
https://codesandbox.io/s/nice-cannon-zohev8?file=/src/App.js
thanks a lot !
background: I did coding for ReactJS app and wanted to deploy on Netlify or Vercel. When I npm run build, I got error.
npm run build error
When I typed npm audit fix, I got this.
npm audit fix msg
I got stuck for days and dont know why I cant deploy my client app.
Here is my package.json file:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"#apollo/client": "^3.5.10",
"#emotion/react": "^11.8.2",
"#emotion/styled": "^11.8.1",
"#mui/icons-material": "^5.5.1",
"#mui/material": "^5.5.3",
"#testing-library/jest-dom": "^5.16.3",
"#testing-library/react": "^12.1.4",
"#testing-library/user-event": "^13.5.0",
"apollo-link-context": "^1.0.20",
"graphql": "^16.3.0",
"graphql-tag": "^2.12.6",
"jwt-decode": "^3.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-moment": "^1.1.1",
"react-router-dom": "^6.2.2",
"react-scripts": "5.0.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.1.2",
"svgo": "^2.8.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"terser-webpack-plugin": "^5.3.1"
},
"proxy": "https://fathomless-mountain-12345.herokuapp.com/"
}
This should be simple but I am not sure what I am missing.
I am trying to recreate the example stated in the docs, modifying only the variable names:
https://firebase.google.com/docs/functions/firestore-events
Trying to log the value of context.params returns undefined.
const functions = require("firebase-functions");
exports.makeUppercase = functions.firestore
.document("/messages/{documentId}")
.onCreate((snap, context) => {
console.log(context.params.documentId); // undefined
console.log(context.params); // undefined
});
package.json
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"#emotion/react": "^11.4.1",
"#emotion/styled": "^11.3.0",
"#mui/icons-material": "^5.0.0",
"#mui/material": "^5.0.0",
"#mui/styles": "^5.0.0",
"#mui/x-data-grid": "^4.0.0",
"#testing-library/jest-dom": "^5.14.1",
"#testing-library/react": "^11.2.7",
"#testing-library/user-event": "^12.8.3",
"firebase": "^9.0.2",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-firebase-hooks": "^3.0.4",
"react-redux": "^7.2.5",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"redux": "^4.1.1",
"redux-thunk": "^2.3.0",
"uuid": "^8.3.2",
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {}
}
What am I missing here? Thanks a lot!
I'm just initiating to react and a friend passed me an app which is intended to show some data transmitted from a remote device over the web. I've installed node.js and npm and my versions are the following
C:\WINDOWS\system32>node --version
v14.15.4
C:\WINDOWS\system32>npm --version
6.14.10
After I run npm i the first time when I tried to compile it gave me some errors related to ELIFECYCLE, then I deleted the node_modules folder, run npm i again and after that npm run start inside the folder where the app is, then I got the error shown in the following picture
My package.json is the following:
{
"name": "demo1",
"version": "7.1.7",
"private": true,
"homepage": "/metronic/react/demo1",
"scripts": {
"start": "react-scripts start -o",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint src",
"format": "prettier --write \"src/**/*.{js,css,scss,html}\"",
"rtl": "webpack"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all",
"ie 11"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"last 1 edge version",
"IE 11"
]
},
"dependencies": {
"#date-io/date-fns": "2.6.1",
"#formatjs/intl-pluralrules": "1.3.5",
"#fortawesome/fontawesome-free": "5.13.0",
"#manaflair/redux-batch": "1.0.0",
"#material-ui/core": "4.9.14",
"#material-ui/icons": "4.9.1",
"#material-ui/lab": "4.0.0-alpha.53",
"#material-ui/pickers": "3.2.10",
"#material-ui/styles": "4.9.14",
"#reduxjs/toolkit": "1.3.6",
"#tanem/svg-injector": "8.0.50",
"apexcharts": "3.19.2",
"axios": "0.19.2",
"axios-mock-adapter": "1.18.1",
"bootstrap": "4.5.0",
"clipboard-copy": "3.1.0",
"clsx": "1.1.0",
"cp-cli": "2.0.0",
"css-mediaquery": "0.1.2",
"date-fns": "2.8.1",
"downshift": "3.4.2",
"fg-loadcss": "2.1.0",
"formik": "2.1.4",
"json2mq": "0.2.0",
"jss-rtl": "^0.3.0",
"lodash": "4.17.15",
"material-ui-popup-state": "1.4.1",
"object-path": "0.11.4",
"perfect-scrollbar": "1.5.0",
"prop-types": "15.7.2",
"react": "16.12.0",
"react-bootstrap": "1.0.1",
"react-bootstrap-table-next": "4.0.2",
"react-bootstrap-table2-paginator": "2.1.2",
"react-datepicker": "2.16.0",
"react-dom": "16.12.0",
"react-draggable": "4.4.2",
"react-inlinesvg": "1.2.0",
"react-intl": "3.6.2",
"react-is": "16.13.1",
"react-perfect-scrollbar": "1.5.8",
"react-portal": "4.2.0",
"react-redux": "7.1.3",
"react-router-dom": "5.1.2",
"react-scripts": "3.2.0",
"react-select": "3.1.0",
"react-swipeable-views": "0.13.9",
"react-syntax-highlighter": "12.2.1",
"react-window": "1.8.5",
"redux": "4.0.5",
"redux-persist": "6.0.0",
"redux-saga": "1.1.3",
"socicon": "3.0.5",
"yup": "0.29.0"
},
"devDependencies": {
"copyfiles": "2.1.1",
"node-sass": "^4.13.0",
"prettier": "1.19.1",
"serve": "11.2.0",
"webpack-cli": "3.3.11",
"webpack-messages": "2.0.4",
"webpack-rtl-plugin": "2.0.0"
}
}
I'm new to React and I can't figure out why this is happening.