Closed scaledrop closed 6 years ago
Hi @scaledrop,
Can you clarify on what you mean with ssr not working with the given configuration and what you have tried to do?
I just tried running the app with the same config of yours. But when i see in the view-source only {react-app}
is coming written inside root element, the whole app should come rendered instead from the server.
Or is there any other port, it is opening with ssr (server side rendering) functionality?
I tried the following. 1. npm run ssr
, 2. serve -s build
but nothing happened. Still app is not rendering from the server. @mauricedb What to do next? Your help will be appreciated.
You need to run npm run start:ssr' and then go to
http://localhost:3001`.
When I look at the resulting served HTML I see the rendered application. Its compressed but after formatting it looks like:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico">
<title>React App</title>
<link href="/static/css/main.c17080f1.css" rel="stylesheet">
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root">
<div class="App" data-reactroot="">
<header class="App-header">
<img src="/static/media/logo.ee7cd8ed.svg" class="App-logo" alt="logo"/>
<h1 class="App-title">Welcome to React</h1>
</header>
<p class="App-intro">To get started, edit <code>src/App.js</code> and save to reload.</p>
</div>
</div>
<script type="text/javascript" src="/static/js/main.b4305b4b.js"></script>
</body>
</html>
Yes, it works. Thanks man!
Great 👍
Hi @mauricedb , ssr not working with the given configuration. Can you please suggest what could be the issue. Have you checked it in the view-source. Was everything rendering the same as it was rendering client side? Please help.