反应快照给反应路线错误

时间:2019-06-24 09:19:33

标签: reactjs npm

反应捕捉和反应路线似乎不能一起正常工作并给出错误信息。 这是错误

 -- ASYNC --
    at Frame.<anonymous> (/Users/apple/Desktop/xyz-web-app/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.goto (/Users/apple/Desktop/xyz-web-app/node_modules/puppeteer/lib/Page.js:629:49)
    at Page.<anonymous> (/Users/apple/Desktop/xyz-web-app/node_modules/puppeteer/lib/helper.js:112:23)
    at fetchPage (/Users/apple/Desktop/xyz-web-app/node_modules/react-snap/src/puppeteer_utils.js:232:22)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) name: 'TimeoutError' }

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xyz-web-app@0.1.0 postbuild: `react-snap`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the xyz-web-app@0.1.0 postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/apple/.npm/_logs/2019-06-24T09_10_08_310Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xyz-web-app@0.1.0 build:dev: `REACT_APP_API_ENV=dev REACT_APP_DEV_ANALYTICS=true npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the xyz-web-app@0.1.0 build:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/apple/.npm/_logs/2019-06-24T09_10_08_348Z-debug.log

我在一个简单的Web应用程序中使用了react snap,该应用程序中没有路由,并且没有错误的postbuild,我可以看到生成了200.html文件,但是该应用程序已经投入生产,并且在应用程序中有很多路由。 js似乎抛出了这些错误。我无法弄清楚为什么在这种情况下会出现超时错误,以及我们如何能够克服这个错误。

我们的路线与此类似 “ react-snap and react-router together make a problem

1 个答案:

答案 0 :(得分:0)

我认为为时已晚,但是如果有人看到了,我检测到没有“路径”的那条路线会导致该问题。

这是错误片段

<connectionStrings configBuilders="CS_Environment">
   <add name="connectionA" providerName="System.Data.SqlClient" connectionString="EnvVarA"/>
   <add name="connectionB" providerName="System.Data.EntityClient" connectionString="EnvVarB"/>
</connectionStrings>

所以,如果我们看一下代码片段

✅  crawled 38 out of 41 (/product/guitar)
✅  crawled 39 out of 41 (/product/keyboard)
�  error at /404.html TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
    at C:\wamp64\www\musichouse\node_modules\puppeteer\lib\LifecycleWatcher.js:142:21
  -- ASYNC --
    at Frame.<anonymous> (C:\wamp64\www\musichouse\node_modules\puppeteer\lib\helper.js:111:15)
    at Page.goto (C:\wamp64\www\musichouse\node_modules\puppeteer\lib\Page.js:674:49)
    at Page.<anonymous> (C:\wamp64\www\musichouse\node_modules\puppeteer\lib\helper.js:112:23)
    at fetchPage (C:\wamp64\www\musichouse\node_modules\react-snap\src\puppeteer_utils.js:232:22)
    at processTicksAndRejections (internal/process/task_queues.js:94:5) {
  name: 'TimeoutError'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! music@0.1.0 postbuild: `react-snap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the music@0.1.0 postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

如果我对此部分进行评论,则一切工作正常! 希望能有所帮助;)