Next Js 13 beta build is slow on server - node.js

I have created an app with next js 13 (beta). The build works normally when none is using the site. But when a lot of users visit the website at the same time, the site becomes slower. Sometimes I cannot even enter the site.
I don't know if this is a problem with next js or node js server.
I am using:
Node 18.14.1 and
Next js 13 beta (with app directory)
Can anyone help me with any solutions to solve the speed issue?

Related

PERN stack deploying to Railway

Hi I've just finished a PERN project that I want to deploying using Railway, should be very easy according the people on the internet.
But I'm just so lost even to begin, I tried connecting to my Github, and I run into a an error already.
Then I wanted to try deploy my local postgres db first, so I set up the postgres db on railway, got the config pages and change my local postgres config to match railway...and then I'm lost
I tried searching on Youtuber and google, but it seems most people are either migrating from heroku, using django, or just not really showing how to deploy from beginning to end.
So I'm here looking for help to see if anyone could guide me to the right place (article or video) that actually shows or teaches how to deploy PERN stack to railway from step 1, which is after finishing the project locally.
A bit more info about the stack I'm using...
react 18
express.js
postgresql 14
node 16
BTW, I don't know if this is way I run into the first issue with Nixpacks, but I have my client (react) folder and server (express + postgres db) folder inside a project folder.
Thank you all so much, I appreciate all the help.

Angular SSR Hot reload not working, no error, hung

I added angular universal to my project and upon saving, it compiles successfully though in the network tab I can see the request for whatever route im on gets hung on pending and the website stays loading forever in the browser. This issue is not present during CRS. Things I have tried that did not work:
I have cloned the same project elsewhere to see if it was some fat finger accident
I have not only add logic to stop DOM methods from being used, I have outright removed the use of them everywhere in the app
I added 3rd party libraries like Domino js to mock methods on Node
I started a completely blank angular project, added nothing to it other than angular universal and I get the same issue!
I will try it on another computer soon to see if it is just an issue on this machine.
What could the issue be? I don't get any errors and refreshing the page it works.
Is hot reload broken for me? missing anything?
EDIT: I have now tried it on a 2 other Windows machines and the result is the same. Perhaps this is a bug. Essentially makes Angular useless to me.
Angular Version 12.1
I was able to get it to work by upgrading my Angular to version 14, and starting a fresh project with SSR added. Frustratingly to say the least but I can finish my project and I copied back in most of my code from the project I was working on.
For what ever reason Angular 11 and 12 were giving me this issue on multiple machines on fresh angular projects. It never gave me any errors to show. I will report back if any time during the rest of the porting of code if the issue persists.
I had the same hassle when initially integrated the Angular Universal to my project.
After a period of time I consider the according workaround:
SSR for the single page applications is useful in production for SEO, Open Graph, etc.
Angular Universal adds additional files:
main.server.ts
app.server.module.ts
Then the classic angular approaches are still possible to be used (the old app.module.ts).
Now for the local development environment I'm continue using the classic "ng serve" command and the Angular continue reloads normally on each file change.
And the SSR is compileing only for the production build.
Then if I want to debug something related to the SSR I'm deploying the production build to the test environment and calling the test urls to see the results.

Node js iss site not open in other computer

I have an node js express app for service module and angular app for web, which is deployed in the windows 10 iis server at the domains
"http://localhost:8011" and "http://localhost:8012"
If i test the site in my browser like
"http://localhost:8011" and "http://localhost:8012"
or
"http://{port number}:8011" and "http://{port number}:8012" it's working
but if same thing i open in others computer the angular application is working without any issue.
but the node js is not working
it's giving the error like
This site can’t be reached
{port number} took too long to respond.
Can any one suggest me what is the error and how to resolve this issue.
Thanks in advance.
It is not very clear from the question but from what I understand you are trying to serve a node express app through IIS?
If this is the case, you should look at the iisnode package which is really helpful. You will also need to install the IIS rewrite-rule module if this is not already installed.
If this is indeed what you are looking for let my know, and I will edit me answer to include more details.

Internal server error deployment on Azure - node.js and Vue.js

I have been looking all over the internet for two weeks now and I have no clue what is happening.
I have an app running on a node.js server. The app uses the Vue.js framework and Vuetify.js, so I don't have a "traditional" js server. The website works perfectly on local, but every time I try and deploy it on an Azure (Windows) web application (per request from the company I am developing for), the only thing that is displayed is this: " The page cannot be displayed because an internal server error has occurred. ".
I did set the Azure Web App to use node.js as instructed on the official documentation.
According to my searches, it is probably a problem with my web.config file, but I can't seem to solve it, so would be really happy if someone could help me out here.
What I have tried so far:
multiple versions of the Web.config file
opening the 443 and 80 port on the Azure Web App to rule out any kind of conflict there
moving around my Vue classes to try and solve a problem there
making the front end in HTML files and in Vue files. Right now it is back into Vue files
I can't seem to find what else to try and would be really grateful if anyone had a solution!
I can add my web.config here if needed
Thanks in advance!

ReastJS, Node, and IIS

I have been following a tutorial from Cory House on Pluralsight about React, Redux, webpack, babel, and a bunch of other support libraries. I am using Visual Studio Code on a windows OS. I have completed the tutorial, which includes a build process that outputs a bundled js file to a dist folder. The build process also runs the app to verify the build is correct (which it is). I then tried to copy the contents up to an IIS server and run it there. However, when I try to access the web site, the index page comes up blank. I verified the bundled js file is called (returns 200 status). That left me wondering if there is an extra step I need to do to transfer an app created using Node to one that can run on IIS.
I should clarify I added a web.config file to the site.
Any help is appreciated
Edit: Here are two errors I am getting on when rendering the page. One of the errors (#2) appears to be a web pack module:
Error 1
Error 2
In error 2, "Attributes" is undefined
I figured it out partially. It had to do with react-router and my routing. When developing and running it locally, it was running at the root of local host:
http://localhost
When I moved it to the IIS server, I had to create an app under the default web site, which changed the apps url to:
http://localhost/ReactJS
That caused my routing to fail and loaded a blank page. However, even though the home page loads now since fixing the routing, it is still not working as I can't navigate to the other views, but at least I have narrowed it down.

Resources