Questions tagged [react-server]
The react-server tag has no usage guidance.
react-server
36
questions
789
votes
32
answers
961k
views
How to specify a port to run a create-react-app based project?
My project is based on create-react-app. npm start or yarn start by default will run the application on port 3000 and there is no option of specifying a port in the package.json.
How can I specify a ...
20
votes
2
answers
19k
views
MJML - Template Interpolation, Dynamic Data, Context
After a lot of searches,
I am having difficulties in finding how:
MJML handles dynamic data and template interpolations
I was expecting something like:
import { mjml2html } from 'mjml';
const ...
14
votes
1
answer
19k
views
how does one call a saga from within another saga?
When using redux-connect (the @asynConnect attribute) how does one chain a second saga, that is dependent on a successful completion of the first saga?
Just simply putting the saga dispatch action in ...
6
votes
1
answer
3k
views
Using csurf with react-server
I would like to add csurf as an express middleware inside the react-server for a universal app.
What I want to achieve is adding the csrf token to a hidden input in a form in the react component to ...
6
votes
0
answers
2k
views
Require SVG cause react-server error: "React is not defined"
In a react-server project generated using generator-react-server loading SVG file like follow triggers a react error.
const fmc = require('../images/logo.svg');
Gives Error
Failed to load page at "....
5
votes
1
answer
254
views
Server rendered React ExpressJS frontend leaking users' Redux store data
I have an ExpressJS server that is sometimes rendering the wrong user's data on initial render. See a (slightly simplified) version below.
The issue is that the index.ejs file is often rendering the ...
5
votes
1
answer
449
views
How do I set headers the react-dom/server renderToString passes to graphql server?
I have a webserver which receives the client's IP from the load balancer via the X-Forwarded-For header, but does not forward it to the GraphQL server, making debugging more difficult.
Is it possible ...
4
votes
1
answer
9k
views
ReactDOMServer.renderToString is not a function
I render react component on server and when go to route get error message:
const renderToString = ReactDOMServer.renderToString
const fac = React.createFactory(React.createClass({
render: ...
4
votes
2
answers
2k
views
React Server-Side Rendering Memory Leak
The code below according to the link react says that:
Unfortunately, this can cause memory leaks for server rendering (where
componentWillUnmount will never be called)
// Before
class ...
3
votes
0
answers
294
views
Server-side React rendering without Babel require hook
Is there any good way to use server-side rendering without Babel require hook?
Right now I'm using it to compile jsx on server and for ES6 module imports/exports (since they are not yet supported in ...
2
votes
1
answer
437
views
Getting error "Could not find preset 'react-server' relative to directory ..."
Full error message:
../assets/around/TCircle.svg
Module build failed: Error: Couldn't find preset "react-server" relative to directory "/Users/admin/Documents"
at Array.map (native)
I'm ...
2
votes
0
answers
189
views
Error configuring third-party wepack loaders with react-server
I am wondering if I could get some help on an error i am receiving with react server. I am trying to use the graphql-tag/loader with react-server and I don’t know how to proceed from the current error....
2
votes
0
answers
859
views
How do I pass JSON data from a Node.js res.render method to react.js on the client
I'm using node.js to accept a request, grab data from dynamodb, format/merge it into an existing JSON template object and return it.
This worked great when using node as a webservice and just ...
1
vote
1
answer
122
views
Adding TypeScript definitions for wrapped classes
I'm using a package called react-server that can take any class and will add methods to it at runtime. It expects to have the class that it wraps to have an interface like
interface {
...
1
vote
1
answer
422
views
Difference between React Server and React Client
I have been researching react.js framework for quite a bit. I am yet to fully understand the difference between client side and server side rendering (despite effort searching for CLEAR difference). ...
1
vote
0
answers
378
views
how to build react js server side jpx and use it on client side with a php server?
I am quite new with React js and I'm pretty sure there are concepts that I am missing and fail to find the right answers to my questions.
So I have a simple php project running on nginx, I am ...
1
vote
0
answers
378
views
React Hydration - How can we hydrate a dynamic page that not fully available at build time?
I am building a website using Express and React. I go with Server-side rendering
Now I am looking for a solution to hydrate my final HTML.
The issue is at the build time, the page is still not ...
1
vote
1
answer
484
views
Unexpected token syntax error I can not see
Thanks for taking a look. This is the syntax error I am getting:
[0] /Users/alexkarasik/Documents/server/services/passport.js:26
[0] async (accessToken, refreshToken, profile, done) => {
[0] ...
1
vote
0
answers
375
views
Best way to improve React Server Side Rendering by avoiding NODE_ENV checks
I am using require('babel-register') to allow for ES6 in node.js and doing server-side rendering of my react components.
In this talk (start around 7:14)
https://youtu.be/PnpfGy7q96U?t=7m14s
one ...
1
vote
1
answer
151
views
ReactJS + ServerSide with ExpressJS - need a way to dictate what to load on the server vs client
So I'm working on POC app, that needs to have SEO optimized content(=== rendered on the server). But within the same route there might be a dynamic data coming from different sources and it might take ...
0
votes
1
answer
312
views
Server-side reactjs how to render all routes server-side / is it necessary for SEO? (Electrode) [closed]
I am using walmart's electrode framework which is a universal framework that can render components/routes in reactjs on the server side and send back compiled html. Currently what happens is that the ...
0
votes
2
answers
49
views
React-server failling without error
I created a simple project from generator-react-server . Everything worked fine.
I just created new route a new page and a new component and changes hello-world.js (page and component) for home.js.
...
0
votes
0
answers
435
views
NextJs 13.4.4 fails to load when "server action" and middelware are present
I have a "use client" form with a "server side" action function.
Whe the middlewear is acting upon the route of that form, the app fails to render with this error.
Client side ...
0
votes
1
answer
2k
views
Why ReactDOMServer.renderToString not returning raw HTML
I write a simple example to test ReactDOMServer.renderToString like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src=&...
0
votes
0
answers
159
views
React: code only works when the development server has disconnected
I was coding a simple todolist, adding an add event to it. The logic seems no problem, but it doesn't work and only worked when having the error:
the development server has disconnected
Below is my ...
0
votes
1
answer
485
views
react web dev server not detecting changes to sass files live
My react app was created with npx create-react-app and is not loading the changes on the local server for changes made in the styles folder.
here is the git repo ,
https://github.com/saulvg1/bottega-...
0
votes
1
answer
2k
views
String Template in React JSX
I created a server and inserted some data in it, Now when I want to refer to that data, it's not displaying the name field, I used string templates to read the name field from the server and show it, ...
0
votes
1
answer
2k
views
Prerender React app as static HTML
I have an interactive landing page (single page - no react router). This landing page will need to be uploaded to a CMS where you just paste in the HTML - meaning I do not need <html> <head&...
0
votes
1
answer
1k
views
Error: no such file or directory in React Server Side Rendering
I trying to do server side rendering on my existing react project but having problem.
I think the problem is memory-fs is unable to find file or directory. I have read many threads but no luck as of ...
0
votes
0
answers
355
views
React DOM not updating after the browser/react server stopped supporting a component
Overnight, my originally working react service was disabled. The reason that it happens is my browser or react server stopped supporting this react component "react-selectize". React-selectize is a ...
0
votes
1
answer
4k
views
Load server data of react-table on button click
I am trying to display a react-table with server side pagination and it's working fine. Issue is that the react-table loads data from server during the page load itself but I am trying to load the ...
0
votes
0
answers
268
views
Add reactid in HTML String
I am parsing html string into react component on server side, but it is just giving me simple html without attaching any react id, causes I cannot perform event handling and binding.
Can anyone help ...
0
votes
1
answer
757
views
react client side rendering with django
I am integrating reactjs with my django, I have done setup and even able to render page from server too, but in client side when it comes to rendering and event handling and attaching, I am getting ...
0
votes
1
answer
540
views
how to define global scope event handler for React server-side rendering
Comparing with client side rendering, I prefer to use server-side rendering for an application with little user-interaction.and webpack is the choice for compiling server side code.
There is a ...
0
votes
0
answers
172
views
ReactJS Server side rendering used as template engine
I want to know if anyone came across ReactDOMServer.renderToStaticMarkup that outputs pure HTML?
Currently the function renderToStaticMarkup is merging together React elements which kinda makes my ...
0
votes
1
answer
2k
views
Sprockets::FileNotFound at / couldn't find file 'react-server' with type 'application/javascript'
I'm returning to a website that I made about a year and a half ago, and when spinning up the rails server, I get this error:
Sprockets::FileNotFound at /
couldn't find file 'react-server' with type '...