514 questions
92
votes
27
answers
206k
views
Invalid options object. Dev Server has been initialized using an options object that does not match the API schema
I have been stuck on this error in my project when I add "proxy": "http://localhost:6000" to my package.json.
This is the error response after yarn start:
Invalid options object. ...
1
vote
2
answers
7k
views
npm ERR! invalid options argument
Software specifications
Software
OS
npm
npx
node
Version
Windows 10
v8.1.2
v8.1.2
v16.13.1
I was following this video and when I try to create a react application on my system by using the following ...
5
votes
2
answers
4k
views
NPM build with version number
Is there a way to update the version number of my react app package.json version variable via command line? Maybe with npm build or before/after npm build?
I have a build server that will run npm ...
0
votes
0
answers
27
views
How to use webpack5 if react-scripts is installing webpack4 by itself?
react-scripts v4.0.3 installs webpack4.44.2 while doing npm i
I want it use webpack5 in my project if I install it explicitly, react gives dependency tree error.
How can I use webpack5 then?
4
votes
1
answer
3k
views
ReactJS Environment variables are undefined on development
I cannot use my environment variables on my development (localhost) with ReactJS.
I made sure of following:
My .env file is in the root directory
My env variable has a prefix of REACT_APP_* and the ...
0
votes
0
answers
271
views
How does React's useRef do to make it's return value ignore dependency warnings?
For example, consider the following code :
const useCustomRef = initialValue => useRef(initialValue);
const CustomComponent = () => {
const ref1 = useRef();
const ref2 = useCustomRef();
...
188
votes
27
answers
239k
views
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.json of a module in node_modules
This is a React web app. When I run
npm start
This error occurred
> [email protected] start
> react-scripts start
node:internal/modules/cjs/loader:488
throw e;
^
Error [...
5
votes
4
answers
1k
views
Load different JS library files for different components
I have a website made in ReactJS. In public/index.html, I have
<head>
<script src="/lib/analyzejs-v1.js"></script>
<script src="/lib/analyzejs-v2.js">&...
-1
votes
1
answer
105
views
Getting error on npm start while starting local host server in React.js project
Getting this error on npm start
'Equipment' is not recognized as an internal or external command,
operable program or batch file. internal/modules/cjs/loader.js:983
throw err; ^
Error: Cannot find ...
0
votes
0
answers
939
views
Unable to minify react application to production
I'm having issued generate a production build of the react application and have this error.
Failed to minify the code from this file:
./node_modules/d3-array/src/count.js:2
Read more ...
2
votes
0
answers
530
views
Preserving comments in create-react-app (react-scripts v4)
Is there any way to keep some comments in the source code for create-react-app (react-scripts v4.0.3 at the time of writing this)? I'm trying to get a comment like this to be preserved in a production ...
0
votes
1
answer
142
views
MeteorUp volumes and how Meteor can access to their contents
First, thank you for reading my question. This is my first time on stackoverflow and I made a lot of research for answers that could help me.
CONTEXT
I'm developing a Meteor App that is used as a CMS, ...
2
votes
1
answer
384
views
Why is . passed as argument to npm without -- delimiter?
I am having trouble figuring out why is npm taking . without -- delimiter.
In the following command . is passed to test script without -- delimiter.
npm test .
test script is defined in package.json ...
0
votes
1
answer
872
views
react-scripts build an unminified version
How do can you get the "build": "react-scripts build" in a package.json to build an unminified version of the code.
I have looked at the answers in this post but they are all too ...
0
votes
1
answer
2k
views
server.tsx module not found when building docker image
When running my create-react-app server on my local machine with npm run start, the server starts and works fine. However, when attempting to dockerize my app, I get the error:
#12 2.029 Error: Cannot ...
2
votes
0
answers
132
views
How to solve this issue in the react app saying Module parse failed: Unexpected token you may need an appropriate loader to handle this file type?
I installed a sample react app which i guess was pretty old.
And i faced this error when i tried npm start
./node_modules/react-github-btn/index.js
Module parse failed: Unexpected token (10:83)
You ...
1
vote
0
answers
161
views
CRA: `react-scripts` Update from 3 -> 4 Breaks Inline CSS Style Usage
I have upgraded the react-scripts package with my TS React App from 3.4.0 to latest 4.0.3 to fix a package security error.
But for some reason this has had the effect of all Inline CSS styles within ...
1
vote
0
answers
100
views
React app's require() outputs `[object Module]` after updating package.json
I am installing a UI framework to a React app and this framework has its own set of dependencies. After updating my package.json, I notice that the framework's use of require() is not working.
For ...
2
votes
3
answers
7k
views
sudo npm run start Admin permissions error?
I am trying to run react application as sudo on port 443 but it is throwing permissions error as follows. I tried running the react script with root privileges too but get the same error.
Command used ...
3
votes
2
answers
7k
views
how to fix Regular Expression Denial Of Services in react script
I got 86 vulnerabilities and 4 of them are high. And then I run npm audit to know what's wrong with my react project
High Regular Expression Denial of Service
Package normalize-...
0
votes
1
answer
257
views
react-scripts build heroku Web process failed to bind to $PORT issue
Have an issue running react-scripts build on a heroku-20 nodejs dyno
Heroku runs npm start which is
"prestart": "cd client && npm install && npm run build",
"...
1
vote
1
answer
1k
views
Installing react-scripts causes vulnerabilities
I uninstalled react-scripts trying to fix bug in terminal earlier. Now when I run npm install react-scripts it gives me this:
Cole@Coles-MacBook-Pro-4 client % npm i react-scripts
npm WARN deprecated ...
4
votes
3
answers
12k
views
internal/modules/cjs/loader.js:888 throw err;
I have a project on Github that ignores the node_modules folder, so I changed my computer and and cloned the repository again.
I used the npm-install-all install all node dependencies, it used to work....
0
votes
1
answer
363
views
Styles was not loaded because its MIME type in React application
I have React application using Craco as configuration layer for create-react-app
Getting issue that styles are not loading randomly in production.
Error: The stylesheet some.chunk.css was not loaded ...
5
votes
2
answers
8k
views
electron & react: No resource with given URL found, DevTools failed to load SourceMap
For production (mac dmg) builds of my electron app, I am unable to trigger location.reload(), connect to redux-dev-tools, and the sourcemap fails to load.
When the app is loaded, the console warns ...