From the original error message, the log in the first request was made "replace transaction pool map on a sync with {}" which means the second request is the issue.
The API response from /api/transaction-pool-map is giving an HTML document rather than a JSON response. You will need to see what exactly the issue is on the API side of this.
However, also for the fact that you do not want your app to error out like that on users, you should also surround the JSON parse code with try-catch or create a new function that safely parses JSON without crashing.
For example a safe parse might be:
functionsafeParse(data){try{constresult=JSON.parse(data);returnresult;// Success valid JSON}catch(e){console.error('JSON data error',data,e)returnundefined;// Data was not valid JSON}}
When I run only one instance of app, either by using npm run dev or by using npm run dev-peer, it works fine. but when I try to run a second instance, app is crashed.
Is there may be an issue with installation or use of "cross-env"???
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
From the original error message, the log in the first request was made "replace transaction pool map on a sync with {}" which means the second request is the issue.
The API response from
/api/transaction-pool-map
is giving an HTML document rather than a JSON response. You will need to see what exactly the issue is on the API side of this.However, also for the fact that you do not want your app to error out like that on users, you should also surround the JSON parse code with try-catch or create a new function that safely parses JSON without crashing.
For example a safe parse might be:
When I run only one instance of app, either by using
npm run dev
or by usingnpm run dev-peer
, it works fine. but when I try to run a second instance, app is crashed.Is there may be an issue with installation or use of "cross-env"???