359 questions
1
vote
0
answers
37
views
How do I use URLSearchParams and similar APIs when writing an isomorphic Typescript package?
I'm trying to write a package in Typescript that is usable in both the browser and Node ("isomorphic"). The purpose of the package is to provide typed endpoints of a website's REST API.
I've ...
0
votes
0
answers
49
views
"Document is not" defined in React
I'm trying to create isomorphic react app. This is my current code:
server.js
import express from 'express';
import React from 'react';
import { renderToString } from 'react-dom/server';
import { ...
1
vote
0
answers
49
views
Debug Doesn’t Work After Migrating SmartGWT from v4.0 to v13.0
I have a test environment with the BuiltInDs project that uses the following components:
JDK 1.8
SmartGWT Eval v13.0-p20221103
GWT 2.8.2
Maven 3.8.6
And to run it I use the following targets:
With ...
2
votes
0
answers
939
views
How to deal with node modules in the browser?
My title is a bit vague, here is what I'm trying to do:
I have a typescript npm package
I want it to be useable on both node and browser.
I'm building it using a simple tsc command (no bundling), in ...
0
votes
1
answer
235
views
isomorphic application using Reactjs & Nodejs
I have an application composed of Reactjs & Nodejs. What I do is to serve a CRA Reacts app using Expressjs, and put some logic on Nodejs side.
CRA simply posts requests to its own backend for ...
4
votes
2
answers
1k
views
isomorphic code for native node.js and browser crypto
There is the isomorphic-webcrypto that pretends doing that but doesn't : it builds separate build for each target.
There is the noble-crypto way to do it, but it's based on if-else conditions and ...
1
vote
0
answers
55
views
Will Isomorphic app expose backend business logic?
I have a question about isomorphic app(like next.js or sapper),
it is usually compiled as two bundles(one for client, another one for server) with Webpack or Rollup,
Then starting the server by ...
0
votes
1
answer
2k
views
webpack: express can't find bundle Error 404
I know this question is was asked a lot but i have tried everything and nothing work!
Here the thing: I am working on an Isomorphic React App for practise witch a big copy of this tutorial of 2017 ...
3
votes
2
answers
7k
views
Nextjs + Docker-Compose: how to resolve container hostname client-side?
New to Docker here. I've been experiencing a confusing roadblock with my Nextjs app, which is running in its own container alongside API and database containers.
My Nextjs app consumes data from the ...
19
votes
3
answers
23k
views
How to best import "server-only" code in Next.js?
In the getServerSideProps function of my index page, I'd like to use a function foo, imported from another local file, which is dependent on a certain Node library.
Said library can't be run in the ...
2
votes
1
answer
1k
views
What are some good ways to reduce FID (First input delay) in isomorphic React application?
FID for pointerdown event in very in my application. Its an Isomoprphic react application. Could anyone suggest some good ways to reduce it. Recently google search console has introduced speed (...
2
votes
0
answers
905
views
How to debug warning: Expected server HTML to contain a matching <a> in <div>
I am using Semantic-UI React and Next.JS but it appears at breakpoint < 768px, my layout completely breaks upon a refresh of the browser. I know because its a react/next.js app they are taking care ...
0
votes
1
answer
566
views
Isomorphic JavaScript library using JavaScript modules - Omitting Node.js dependencies in the browser?
So I'm planning on writing a package which a user will hopefully be able to use on both Node.js and in the browser.
On the Node.js side it will use the fs module. This does not exist in the browser ...
1
vote
1
answer
3k
views
Having trouble tracking down Node JS memory leak
We're struggling with a memory leak problem on our first substantial Node/React Isomorphic web application. In 48 hours or less we use over 500mb of memory. Most of what the application does is fetch ...
1
vote
0
answers
2k
views
Chart not fill ant-row width, even with zero margin and padding
As you can see from the picture below, the chart cannot use 100% of the antd row's width. I tried setting the width to 100% and window.innerWidth but none of those worked.
The chart is drawn using ...
9
votes
1
answer
9k
views
Next.js - understanding getInitialProps
I have an app that uses next.js along with Apollo/ Graphql and i'm trying to fully understand how the getInitialProps lifecycle hook works.
The lifecycle getInitialProps in my understanding is used ...
1
vote
0
answers
935
views
Uncaught (in promise) TypeError: Cannot read property 'file' of undefined
I’m working on an Isomorphic react application using redux and I'm getting a promise error even this exact same code is working on previous modules.
Here i'm fetching data through fetchMobile action ...
1
vote
0
answers
3k
views
Doing a PATCH with a file and some fields using multipart/form-data
I am doing a request to my server to patch some regular form fields as well as upload an image.
If I do these alone in separate requests all works perfectly, but nothing works if the form data and ...
-1
votes
2
answers
942
views
promise is still pending in then block - how to resolve? [duplicate]
I have code something like -
fetch(`${URL}${PATH}`)
.then(res => {
const d = res.json();
console.log("data is: ", d);
return d;
})
It logs data is: Promise { <...
0
votes
0
answers
736
views
How to use React.Component with renderToString method?
I tried to do the server side render using renderToString method.
function handleRender(req, res) {
const html = renderToString(
<Counter />
);
res.send(renderFullPage(...
2
votes
0
answers
912
views
How to implement isomorphism for React app with .Net Core
I have created a new starter project based on the "reactredux" template provided by .Net Core (2.1) and I see that it doesn't implement isomorphism.
There's some hints that it should be supported ...
4
votes
1
answer
1k
views
Isomorphic React vs Gatsby (Static Site) React
Are there any key differences or benefits to using isomorphic (server side) react, vs using a statically generated react app with for example gatsby?
I understand, both will generate html to send to ...
7
votes
1
answer
8k
views
What's the alternative to ComponentDidMount in React Server Rendered Application?
I have created an isomorphic React application. Everything works fine till I was trying to put some animations on my elements. If it was a client-side rendering app, I would do that by writing the ...
2
votes
1
answer
2k
views
React-router and Link in server side rendering
I'm converting a react app to be rendered server-side.
I have things like this:
import React from 'react'
import R, { Link } from 'react-router'
console.log("router:", R) // R is undefined!
class C1 ...
1
vote
1
answer
3k
views
How to access the props from server-side rendering when re-render the component in client side?
I have done lots of research, and failed to make it work though.
It is based on express.js and react in a isomorphic application.
I used renderToString() to parse my component and send it back to ...