#Remix Build does not correctly resolve internal dependencies

1 messages · Page 1 of 1 (latest)

short oasis
#

Trying to serve remix through the express adapter leads to the following issue in a pnpm workspace (turborepo). With the Remix Server without an adapter everything worked fine.

Trying to run the output index.jsfile through the default express template server.jsfile leads to the following issue:

> cross-env NODE_ENV=production node ./server.js

Error: Cannot find package 'framer-motion' imported from /Users/niclas/Documents/Projects/chattopdf-frontendd/apps/www-remix/build/index.js
Did you mean to import [email protected][email protected][email protected]/node_modules/framer-motion/dist/cjs/index.js?

Now framer-motionin this case is just imported through a internal workspace package installed like:

"packages": {
  "@chattopdf/chatbot": "workspace:*",
}

And not by the remix project iself.

Is there anything to take care of to fix the issue?

#

This is my remix.config.js ``` /** @type {import('@remix-run/dev').AppConfig} /
export default {
ignoredRouteFiles: ["**/.
"],
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
serverModuleFormat: "esm",
future: {
v2_dev: true,
v2_errorBoundary: true,
v2_headers: true,
v2_meta: true,
v2_normalizeFormMethod: true,
v2_routeConvention: true,
},
tailwind: true,
serverDependenciesToBundle: ["@chattopdf/api-client", "@chattopdf/chatbot"],
};