Closed kalaracey closed 10 months ago
Hey @kalaracey thanks for opening the issue! I can reproduce this behaviour on our test project so it's definitely happening.
Looking at the git history it looks like this command hasn't had much attention for a long time. I wasn't on the team when this was created so don't have any specific insight to offer at the moment. I can do my best to try and help you out if there's anything specific you come across.
A little notice since you said you'd be interested in working on this - which is awesome btw! The team is trying to focus on a few important milestones for our next epoch so we might not be able to be as responsive to this issue as we would like to be. I'll still try to make sure we get back to you though!
I've been running into this. Sharing some debug info I found today - if you paste something that goes past the "db", the console doesn't hang, e.g. db.
. Seems like it's an issue with how the repl is interpreting the prisma client accessed through db.
Additionally, when you open a console, as long as you do not start with db
it does not freeze. It seems like some eager fetching off all possible Prisma objects in the DB or waiting on a promise that may never come.
> var posts = db.post.findMany()
undefined
> posts
[
{
id: 1,
title: 'Welcome to the blog!',
body: "I'm baby single- origin coffee kickstarter lo - fi paleo skateboard.Tumblr hashtag austin whatever DIY plaid knausgaard fanny pack messenger bag blog next level woke.Ethical bitters fixie freegan,helvetica pitchfork 90's tbh chillwave mustache godard subway tile ramps art party. Hammock sustainable twee yr bushwick disrupt unicorn, before they sold out direct trade chicharrones etsy polaroid hoodie. Gentrify offal hoodie fingerstache.",
createdAt: 2023-10-14T23:29:54.403Z
},
{
id: 2,
title: 'A little more about me',
body: "Raclette shoreditch before they sold out lyft. Ethical bicycle rights meh prism twee. Tote bag ennui vice, slow-carb taiyaki crucifix whatever you probably haven't heard of them jianbing raw denim DIY hot chicken. Chillwave blog succulents freegan synth af ramps poutine wayfarers yr seitan roof party squid. Jianbing flexitarian gentrify hexagon portland single-origin coffee raclette gluten-free. Coloring book cloud bread street art kitsch lumbersexual af distillery ethical ugh thundercats roof party poke chillwave. 90's palo santo green juice subway tile, prism viral butcher selvage etsy pitchfork sriracha tumeric bushwick.",
createdAt: 2023-10-14T23:29:54.407Z
},
{
id: 3,
title: 'What is the meaning of life?',
body: 'Meh waistcoat succulents umami asymmetrical, hoodie post-ironic paleo chillwave tote bag. Trust fund kitsch waistcoat vape, cray offal gochujang food truck cloud bread enamel pin forage. Roof party chambray ugh occupy fam stumptown. Dreamcatcher tousled snackwave, typewriter lyft unicorn pabst portland blue bottle locavore squid PBR&B tattooed.',
createdAt: 2023-10-14T23:29:54.411Z
}
]
>
Additionally, even using await
in front of db
the query works with absolutely zero hang.
I am also seeing this, however it doesn't seem to resolve itself even after waiting 10 seconds. Pasting directly into the terminal works and prefixing with await
also works.
The console isn't getting much use, so we likely won't get to investigating this anytime soon. But please keep commenting and/or reacting to posts to indicate interest in this issue to keep it on our radar ✈️
It should be caused by this one: https://github.com/prisma/prisma/issues/18292
Mind if I make a PR @Tobbe ?
@ymc9 Please do! 👍
@ymc9 Please do! 👍
Sure. Here you go 😄: https://github.com/redwoodjs/redwood/pull/9623
What's not working?
I am going through the tutorial and I have gotten to the part where you begin to use
yarn rw console
. However, when I typedb.
(i.e. the beginning ofdb.post.findMany(...)
) the console hangs for five to ten seconds atdb
. If I backspace from e.g.db.post
to the 'd' character, it will similarly hang atdb
before backspacing through 'b' for five to ten seconds.Perhaps there is some sort of autocomplete that is blocking the thread.
How do we reproduce the bug?
Then set up the
SESSION_SECRET
in.env
.Finally, open
yarn rw console
and attempt to typedb.post.findMany()
.What's your environment? (If it applies)
Are you interested in working on this?