-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting a built project trigger error: Cannot find module '.../.output/server/node_modules/.../index.js' imported from .../.output/server/index.mjs #177
Comments
Is there a reproduction? Ill try to add drizzle to a project and see if that shows the problem |
I'm running into an issue like this in a monorepo where we run several e2e test apps of all kinds of frameworks. For example a solidjs app and a solidstart app. We aren't using drizzle, but one of our own packages that has an optional peer dependency on solid router. As mentioned here, this issue happens out of the box with a project created via We're using pnpm, but I've also had this issue with yarn. It does not happen outside of our repo. |
@nksaraf This problem resurfaced again. This problem basically exists when Question: Is there a way to force the bundler to include some modules/packages? This could possibly be fixed with a config, but I could not find the relevant config. I tried using |
which dependency is this? we could find the appropriate place to configure this. |
@nksaraf I managed to create a minimal repo: https://stackblitz.com/edit/vitejs-vite-owbuqy?file=src%2Froutes%2Findex.tsx,src%2Fapp.tsx,package.json There is only 1 index file essentially, which calls a
I have tried many configurations related to |
Here's another example repropduction: https://stackblitz.com/~/github.com/andreiborza/vinxi-solidstart-sentry?file=package.json
When looking at Looking through all
I'm bringing this up because last time (#177 (comment)) this problem was solved by aligning versions of I also suspect some tree-shaking/bundling issues as @lominming mentioned. |
@lominming You could do something like this but seems very brittle, also does not copy dependencies import copy from 'rollup-plugin-copy'
import {defineConfig} from "@solidjs/start/config";
export default defineConfig({
server: {
rollupConfig: {
plugins: [
copy({
targets: [{
src: 'node_modules/drizzle-orm',
dest: '.output/server/node_modules',
}],
hook: 'writeBundle',
})
]
}
}
}); |
Im using Tanstack start with Coolify and also get this error:
|
I think this is related to vercel/nft#428 and might be solved with nitrojs/nitro#2703 (hopefully) landing in nitropack. |
We have a similar issue where it doesn't copy certain files from a npm package. Tried the suggestion above by adding
The only file of that module copied is the index.mjs. |
Problem: I can build the project successfully (vinxi build) but cannot start the built project (vinxi start). This is blocking us from pushing to production now since we upgrade solid-start.
Context: Wasn't sure whether this is directly a Vinxi bug or a Solid-Start bug. There's a thread going on in Discord but was suggested to open an issue. @nksaraf
Description:
This is a new issue since upgrading to
solid-start 0.4.0
(beta2)Build works
vinxi build
but starting the built projectvinxi start
will fail with this error:Cannot find module '.../.output/server/node_modules/drizzle-orm/postgres-js/index.js' imported from .../.output/server/index.mjs
The
.output/server/index.mjs
file looks like:And inside
.output/server/node_modules/drizzle-orm
is missing the folderpostgres-js
The text was updated successfully, but these errors were encountered: