[ERR_MODULE_NOT_FOUND]: Cannot find module ... `esm` ... Did you mean to import ... `cjs` ...?
Hey all! First time poster here. Wish I didn't hvae to...
I've been trying to deploy my TanStack Router SSR app to Netlify for the last couple days and I'm starting to lose hope. I thought something like that would be a breeze in 2025 but it looks like it's still a mess. So many yet so few pages documenting what needs to be done and all showing something different. Briefly looked at the TanStack Start page but seeing how it's a "framework" I ignored it... until today when I realised that it's not really a framework but just Router with a bunch of build tools on top of it.
So I installed it and finally managed to get my project to build and deploy to Netlify but now it keeps throwing the following error in the function logs:
3 Replies
like-goldOP•3w ago
It feels like I've tried everything at this point and nothing seems to work. I changed Node from v22 to v20, I tried installing this
bs58
library in my own package.json
file (it's not a dependency of my app, it must be a dependency of some other dependency) but it doesn't really help because as soon as I do some other library fails with the same error and I don't want to start adding every single library to my own package.json
file.
Does anyone have any idea what is going on and why is it trying to load files that don't exist? I see a few similar bug reports from a month and two back with the same errors but they're all a bit different and none gives a generic answer apart from "I upgrade that library".like-goldOP•3w ago
Here are the folder structures (although I don't think it's because of that as it feels as if the loader doesn't know what to load). I'm using pnpm hence it's not a flat structure like with NPM.


dependent-tan•3w ago
it's not really a framework but just Router with a bunch of build tools on top of it.so .... what would be your definition of a "framework" ?