how to read n rewrite package.json re: react-scripts

here is the package.json. I need to upgrade it to react-scripts 5.0.0 but I don see react-scripts, where is it? how I can add this. I am doing this bc failed to fetch data from strapi using axios due to err process not defined according to solutions here :https://stackoverflow.com/questions/70368760/react-uncaught-referenceerror-process-is-not-defined
{
"name": "vite",
"private": true,
"version": "0.0.0",
"type": "module",
"overrides": {
"react-error-overlay": "6.0.9"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"preinstall": "npx npm-force-resolutions"
},
"dependencies": {
"axios": "^1.4.0",
"localforage": "^1.10.0",
"match-sorter": "^6.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.11.2",
"sort-by": "^1.2.0",
"react-error-overlay": "6.0.9"
},
"devDependencies": {
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.38.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"vite": "^4.3.2"
}
}
{
"name": "vite",
"private": true,
"version": "0.0.0",
"type": "module",
"overrides": {
"react-error-overlay": "6.0.9"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"preinstall": "npx npm-force-resolutions"
},
"dependencies": {
"axios": "^1.4.0",
"localforage": "^1.10.0",
"match-sorter": "^6.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.11.2",
"sort-by": "^1.2.0",
"react-error-overlay": "6.0.9"
},
"devDependencies": {
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.38.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"vite": "^4.3.2"
}
}
Stack Overflow
React Uncaught ReferenceError: process is not defined
I am getting issues with iframe. Till today everything was working as expected. Today I added a very simple Modal component and somehow iframe started appearing. It appears when I am editing the fi...
2 Replies
Daryl
Daryl12mo ago
I don't think you need to do that. From your package.json, I see that you started your project from a Vite template. Vite does not use react-scripts, that library was mainly used by Create React App. As your getting issues with axios and Strapi, can you share the errors related? If you can reproduce it in Codepen or Codesandbox, that would be great.
redtypoOooOo
redtypoOooOo12mo ago
hi thanks for your reply. I am working with this tutorial and met this error. feel free to check it out. https://discord.com/channels/436251713830125568/1119649265787084831/1119649265787084831