-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxy option not working/webpack-dev-server debugging advice #2566
Comments
How are you testing it ? |
I am not sure on which one you meant but I will describe for both.
|
Could you please post the code or share the repo for some insights please :) ? |
Goodmorning codedavinci and thank you for answering small Update: Today the proxy redirection works. For the story Running npm install creates a folder of npm_modules one of them is react-scripts. I will try to create a small project and upload it for the shake of the example. |
No problem at all @dimitrius.
Node_modules is the folder of third party dependencies. It's usually not
advised to debug or change this code because it is what sustain the react
CLI. Think as if it's the config files where magic happens.
But if you do go through a case where you need to debug, I advise you to
set some console.log() or just go through the log file generated based on
the error.
Hope it helps you
…On Jun 20, 2017 4:04 AM, "Dimitrios Proios" ***@***.***> wrote:
Goodmorning codedavinci and thank you for answering
small Update: Today the proxy redirection works.
I restarted my computer possible that fixed something I am not aware of.
But I am still unable to pause with with a breakpoint the web-dev-server
so I will focus on that,
unfortunately I don't have permission to open source... I will try it
For the story
This is the package.json file of the project :
{
"name": "xxx",
"version": "xxxx",
"private": true,
"devDependencies": {
"react-scripts": "0.9.5"
},
"dependencies": {
"jQuery": "^1.7.4",
"react": "^15.5.4",
"react-dom": "^15.5.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:3001"
}
Running npm install creates a folder of npm_modules one of them is
react-scripts.
What I want to do is to manage to pause and see the contents of the
variables the script in the runtime of the script.
Specifficaly I am tryingI want to pause the line 181 in start.js script
when there is a an ajax request from the client app.
I will try to create a small project and upload it for the shake of the
example.
In general how do you debug npm_modules dependencies??
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2566 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARCUe6FZGfTpCPCtAEXdFJlAWU-yanKsks5sF3z4gaJpZM4N-KnM>
.
|
console.log() /dir() work fine in debugging. It will help next time I hope. |
@partizanos, I am afraid you may not have this option as the If you feel that the CLI isn't properly working for you, you could always |
I just thought since the react-scripts it's running on nodeJS environment it might be possible to run it with an option. with something like: |
Going to close since the issue appears resolved. |
Hello I am trying to make the proxy to work for the localhost on the client side.
I don't know why the proxy option on the package.json file of my project does not have the desired effect of forwarding the request to the proxy server, which is running on port
{
{... },
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
},
"proxy": "http://localhost:3001"
}
`
(In the same project I had managed to forward it before but I am not sure why it does not work anymore)
To solve the problem above I am trying to put a breakpoint on the start.js script too, on the part that is checking for the proxy option
`
.....['text/html', '/']
}));
debugger;
//start.js script line 87
if (proxy) {
if (typeof proxy !== 'string') {
console.log(chalk.red('When specified, "proxy" in package.json must be a string.'));
console.log(chalk.red('Instead, the type of "proxy" was "' + typeof proxy + '".'));
console.log(chalk.red('Either remove "proxy" from package.json, or make it a string.'));
process.exit(1);`
but the debugger statement doesnt work either.
My two questions are :
2.how I could breakpoint the webpack dev server or see the its logs apart from the linting errors
Thank you in advance
The text was updated successfully, but these errors were encountered: