Liuyll / easy-react-cli

easy-react-cli
3 stars 0 forks source link

koa-static导致的ECONNRESET #5

Open Liuyll opened 3 years ago

Liuyll commented 3 years ago

?csr=true时,渲染的html如下

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>easy-react-ssr</title>
    <link href="/index.css" rel="stylesheet"></head>
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/react/17.0.1/cjs/react.development.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.1/cjs/react-dom.development.js"></script> -->

    <body>
        <div id="app">
            <!--server render body-->
        </div>
    <script type="text/javascript" src="/runtime~index.file.js"></script><script type="text/javascript" src="/vendor.chunk.js"></script><script type="text/javascript" src="/index.chunk.js"></script></body>
    </html>

导致直接访问了koa-static的静态文件,连接没有断开,第二次刷新出现的econnreset

Liuyll commented 3 years ago

定位到的是vendor.chunk.js文件