-
Notifications
You must be signed in to change notification settings - Fork 4
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
Module not found #5
Comments
Hi @michaelpomogajko ! There's a janky generate command that you have to run to create your Bridg client along with your Prisma client (this will be replaced in time with a Prisma generator). Not sure if you ran that, or if it failed maybe? {
"scripts": {
"generate": "npx prisma generate && npm explore bridg -- npm run generate"
}
} Now that I think about this, there should definitely be some sort of default index.js though, that emits some sort of error telling you that the client hasn't been generated |
I did ran it, it generated the tmp folder in the package as seen in the last image |
Ah, I see, thanks. Was there any error output from the generate command? If you're on windows, can you try installing this version of Bridg and letting me know if it fixes it for you? npm install [email protected]
npm run generate There was an issue in the past with the generate command on Windows machines. I thought I fixed it, but it's possible you might need to use WSL as a temporary fix. If not, could you possibly give me some more info about your project, OS, etc? Did you clone one of the example apps, or setting it up on your own? I see you're using Next, which is definitely the framework I've tested out the most. But it's possible there's an issue with specific versions. Any chance you could create an example repo that reproduces the issue? Thanks so much opening this, will try to figure out whatever is causing it ASAP. |
Hi, yeah I'm receiving the following error when running the generate command
Here's the example repo I'm on a M1 Mac |
Oh jeeze, I'm really sorry I missed this when you initially posted the package.json. This is a known issue with Prisma 5. I'm hoping to have a fix out this weekend (when I'm not swamped with my actual job, hah). https://github.com/JoeRoddy/bridg/blob/main/README.md#add-bridg-to-an-existing-project I think I've tested up to 4.13.0 and had that working, no promises past that. Sorry again, you provided enough detail in your initial comment that I should've caught that. |
Downgraded to prisma 4 and still receive an error when running the custom generate
I'n on a MacBook M1 with 64GB RAM |
Ok thanks, I can take a look tonight and see if I can repro. I have seen that error before, but it was when I used newer versions of Prisma. What version of Prisma are you using where you see that? Did you try 4.10.1 by any chance? You could also try updating the script to enforce a specific version of the prisma cli, just in case: I know what's causing the out of memory error (it's basically trying to compile all of prisma's ts files and all their dependencies, which it shouldn't need to), hoping to have a big rewrite out this weekend that ideally will fix that issue and allow newer versions to work, and make it easier to setup Bridg in the first place. Really sorry you're having so many issues with this, would really like to get this fixed for you so you can try it out. |
I did try it with the latest @4.x.x version of prisma. No rush, I'm just trying it out since I'm really excited about the approach the library takes. Actually thought of something like this myself couples months ago, but didn't have the skills to actually do it 😄 Happy that I can help with testing |
Yeah I think the issue started happening in a higher version of 4, and still exists in Prisma 5. The latest 4.x would def have the issue too. I'm not sure of the exact version of Prisma where that heap error started happening though. Try out 100% appreciate your help 🙌 |
@michaelpomogajko If you get a chance at some point, I just dropped a big rewrite. Bridg now uses a prisma generator to create the client, instead of that janky Installing: npm i [email protected]
npm i [email protected]
npm i -D @prisma/[email protected]
generator client {
provider = "prisma-client-js"
}
// Add this UNDER your prisma client
generator bridg {
provider = "bridg"
}
|
hi @JoeRoddy, tested it and it works out of the box. Thanks! |
If anyone else runs into this issue, make sure you update Bridg and Prisma, instructions here: #5 (comment) Thanks again for opening this Michael! |
I'm still having issues with this on the demo npm run generate
> [email protected] generate
> prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Generator "bridg" failed: {
"name": "next-testing",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"generate": "prisma generate",
"push": "npx prisma db push"
},
"dependencies": {
"@next/font": "13.1.4",
"@types/node": "18.11.18",
"@types/react": "18.0.27",
"@types/react-dom": "18.0.10",
"bridg": "1.1.0",
"eslint": "8.32.0",
"eslint-config-next": "13.1.4",
"next": "^13.5.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.9.4"
},
"devDependencies": {
"@prisma/client": "5.1.1",
"prisma": "5.1.1"
}
}
|
thanks @bherbruck Is that the end of the output? it just says: What operating system are you on? |
I'm on debian in a devcontainer |
Thanks for the quick reply! Can I ask which package manager you're using (npm, yarn etc) and what version? Sorry, I forgot to ask in my original reply. I'm guessing it's likely an OS specific issue though. |
I'm using npm |
Hi,
although installed, it seems that the module is not being found when importing.
The text was updated successfully, but these errors were encountered: