-
Hi @lazarv (or others) I'm getting a hard-to-diagnose error most of the time when I run my project https://github.com/nickw1/lilt Steps: in production mode. Running in dev mode is fine, and build is fine, but when trying to start I get this error (node 22.14.0, Linux):
With the latest Steps:
I tried reproducing it with a simpler example (the session example from the repo, I chose this as It's not critical as I can use Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @nickw1! When a similar error happens, you can use The modified import { defineConfig } from "vite";
export default defineConfig({
// base: '/lilt/', // uncomment if you have a non-default base dir e.g. https://hikar.org/lilt
port: 3002,
resolve: { external: ["iron-session"] },
}); I also removed the |
Beta Was this translation helpful? Give feedback.
Hi @nickw1!
When a similar error happens, you can use
pnpm why
with the package name of the missing dependency to check what is using the dependency that was not found, and mark that dependency as external. In this case,iron-session
. You need to mark the highest-level dependency as external, as only these are resolvable directly for your application when using pnpm. You can also solve this by installing the missing dependency.The modified
vite.config.mjs
that works:…