2,526,699 questions
0
votes
0
answers
19
views
Transpiling a Shared TypeScript Library in a Next.js Website
I have a monorepo with two packages
a TypeScript shared library, ESM (shared-library)
a TypeScript Next.js app, ESM (my-website)
The Next.js app imports code from the shared library. Everything ...
0
votes
1
answer
33
views
How to refactor repeated conditional logic for multiple similar elements in JavaScript?
I have a restaurant ordering app where I'm displaying order items. Currently, I have repetitive code for each menu item (pizza, hamburger, beer).
Current code (simplified):
function displayOrder(...
0
votes
0
answers
23
views
Big Java resource file compare
I’m comparing two very large JavaScript files generated by MicroStrategy ( unminified versions from 11.4.3 and 11.5). Both files are 9–10 MB and contain long, auto-generated JS blocks.
When I use ...
0
votes
0
answers
24
views
Browser Rendering Edge Case [closed]
Why does a React component rerender only when a CSS variable is updated via JavaScript, but not when updated via a parent React state?
-3
votes
0
answers
41
views
How can I make a right sidebar stop scrolling once its content ends while the left section continues scrolling? [closed]
I have a layout where:
Top section contains a job card
Below it, the page is split into two columns
Left column has long job list content (taller)
Right column has employer details (shorter)
I ...
Advice
0
votes
2
replies
41
views
useNavigate vs window.location.href( or window.open)
Title
React Router navigate does not work with external URLs
Body
I am working on a project where clicking a lecture card should redirect the user to an external website such as Udemy or Inflearn.
At ...
-3
votes
0
answers
25
views
How can I dispose of a JavaScript Image object [duplicate]
I have several hundred jpg files on my club's website with different resolutions and I'm trying to write some JavaScript to list them. I think I have a problem with disposing of or waiting for the ...
-3
votes
1
answer
66
views
Sidebar functionality without duplicated code
I'm refactoring my website right now, and I'm new to Next.js. All the tutorials I've found online have been super helpful, but something I still don't get is how to set the class name of a div in A....
0
votes
0
answers
40
views
Next.js 14 ignoring my API route completely even though route.ts exists and is named correctly
I'm working on a Next.js (App Router) project and my API route is not being picked up at all. Every time I send a POST request from the client, I get a 404 Not Found.
The route I'm trying to hit is:
/...
1
vote
1
answer
30
views
In NextJS 16+, can "use cache" directive work on server actions?
I am trying to cache the response of a query inside a server action file:
export async function getCachedSession(userCacheToken: string, token: string) {
"use cache";
cacheTag(`user-session:...
4
votes
1
answer
56
views
How to play a pitched sound n times?
I'm making a game and am using WebAudio API for audio.
I want to play a given sound exactly n times, with a different pitch than normal.
As long as I don't change the pitch, i.e. keep playbackRate = 1....
-1
votes
1
answer
42
views
Node JS page not displaying [closed]
I can get Express to serve plaintext pages, but I'm trying to get it to serve HTML
All I get in the web browser is "Cannot GET /concerts"
import express from 'express'
import join from "...
Advice
0
votes
1
replies
29
views
Handling and error checking with RxJs HTTP calls
I'm working with Angular 21 and I've added an interceptor like this:
export const httpErrorInterceptor: HttpInterceptorFn = (req, next) => {
return next(req).pipe(
catchError((error: ...
Advice
0
votes
0
replies
23
views
How to use contentFor() in express ejs layouts?
I have been trying to find a video or explanation on how to use contentFor(). I already read the documentation, but it is still not working.
A view:
tyler
<%- contentFor('foo') %>
club
<%- ...
0
votes
0
answers
62
views
Stale props in client component embedded in ISR-rendered server component
In a NextJS16+ app using app router, assume the following server component:
const getData() = async () => {
"use cache";
cacheTag("data");
return databaseCall();
};
const ...