dsmurl
Explore posts from serversTTCTheo's Typesafe Cult
•Created by dsmurl on 2/27/2025 in #questions
nextjs and express, dev but no build?
I have a nextjs monorepo with a backend in express with trpc. I'm trying to get the first push up to amplify but I can't get the 'next build' to run property. The dev works fine and everything resolves and runs, but the next build can't figure out the trpc link. Here is my basic repo. Can anyopne tell me why the linking isn't working. It has to be something with the monorepo tsconfig setups. pnpm monorepo, trpc11, nextjs15, and express. I've been stuck for 2 weeks! https://github.com/dsmurl/an-express-next
3 replies
monorepo can't resolve trpc context
I'm usig a mono repo with next15 and trpc v11 + pnpm. I can't seem to share the trpc across the monorepo for some reason. What is weird is that the dev server runs it well but the build can't seem to find the useContext from the trpc. Says it collides with something.
https://github.com/dsmurl/an-express-next error with
Type error: Property 'Provider' does not exist on type '"The property 'useContext' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'useUtils' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'Provider' in your router collides with a built-in ...'.
Does anyone have a decent idea or a suggested setup for express backend, nextjs front, and trpc 11? I want a mono so that I can share a lot betyween them + share hooks with future projects. I want express so that I can scale them in AWS. and next pushed through AWS amplify. That's the current idea ayways. This is my experimental project where the dev works but the build fails. This is killing me for over a week now.https://github.com/dsmurl/an-express-next error with
pnpm run build
2 replies
Why does effect re-fire? How to use createStore values in effect correctly?
Check out this component. Why does the effect refire when I'm only changing person.name.first? It has something to do with the Proxy object, but how is that useful if any change to any store fires all the effects where any part of the store is referenced?
import type { Component } from "solid-js";
import { createEffect } from "solid-js";
import { createStore, produce } from "solid-js/store";
import type { Person } from "../types/Person";
type Props = {};
export const StoreTest: Component<Props> = () => {
const [person, setPerson] = createStore<Person>({
name: {
first: "Brandon",
last: "Sanderson",
},
age: 45,
});
const changePersonFirstName = (name: string) => {
setPerson(
produce((p: Person) => {
// Immer style store update
p.name.first = name;
})
);
};
createEffect(() => {
// Why does this fire the effect again?
console.log(person);
});
return (
<div>
<h2>Store Test:</h2>
<p>
Person is named {person.name.first} {person.name.last} and he is{" "}
{person.age}
</p>
<button class="btn" onClick={() => changePersonFirstName("Sam")}>
Person first name change
</button>
</div>
);
};
82 replies