Hello, I just started using redwood I am trying to go over the tutorial on Redwood.
Currently I canβt go past Chapter 2:section1(Creating a Post Editor), I am getting this error:
api | 00:57:10 π² incoming request POST xxx /graphql
api | 00:57:10 π Parsing request to extract GraphQL parameters
api | 00:57:10 π Processing GraphQL Parameters
api | 00:57:10 π graphql-server GraphQL execution started: FindPosts
api | 00:57:10 π² Starting a sqlite pool with 13 connections.
api | π Custom
api | {
api | "prisma": {
api | "clientVersion": "5.2.0"
api | },
api | "timestamp": "2023-09-14T04:57:10.404Z",
api | "target": "quaint::pooled"
api | }
api | 00:57:10 π¨
api | Invalid `db.post.findMany()` invocation in
api | D:\GitHub\cs490-hw2\api\src\services\posts\posts.js:4:18
api |
api | 1 import { db } from 'src/lib/db'
api | 2
api | 3 export const posts = () => {
api | β 4 return db.post.findMany(
api | Operation 'findMany' for model 'post' does not match any query.
api | π Custom
api | {
api | "prisma": {
api | "clientVersion": "5.2.0"
api | },
api | "timestamp": "2023-09-14T04:57:10.410Z",
api | "target": "post.findMany"
api | }
api | 00:57:10 π² request completed 47ms
api | 00:57:10 π¨ graphql-server
api | Invalid `db.post.findMany()` invocation in
api | D:\GitHub\cs490-hw2\api\src\services\posts\posts.js:4:18
api |
api | 1 import { db } from 'src/lib/db'
api | 2
api | 3 export const posts = () => {
api | β 4 return db.post.findMany(
api | Operation 'findMany' for model 'post' does not match any query.
api |
api | π¨ GraphQLError Info
api |
api | {
api | "path": [
api | "posts"
api | ],
api | "locations": [
api | {
api | "line": 2,
api | "column": 3
api | }
api | ],
api | "extensions": {}
api | }
api |
api | π₯ Error Stack
api |
api | PrismaClientUnknownRequestError:
api | Invalid `db.post.findMany()` invocation in
api | D:\GitHub\cs490-hw2\api\src\services\posts\posts.js:4:18
api |
api | 1 import { db } from 'src/lib/db'
api | 2
api | 3 export const posts = () => {
api | β 4 return db.post.findMany(
api | Operation 'findMany' for model 'post' does not match any query.
api | at vn.handleRequestError (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:123:6902)
api | at vn.handleAndLogRequestError (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:123:6119)
api | at vn.request (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:123:5839)
api | at async l (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:128:9763)
api | at async D:\GitHub\cs490-hw2\node_modules\@graphql-tools\executor\cjs\execution\promiseForObject.js:18:35
api | at async Promise.all (index 0)
api |
api | 00:57:10 π¨
api | Invalid `db.post.findMany()` invocation in
api | D:\GitHub\cs490-hw2\api\src\services\posts\posts.js:4:18
api |
api | 1 import { db } from 'src/lib/db'
api | 2
api | 3 export const posts = () => {
api | β 4 return db.post.findMany(
api | Operation 'findMany' for model 'post' does not match any query.
api |
api | π¨ GraphQLError Info
api |
api | {
api | "path": [
api | "posts"
api | ],
api | "locations": [
api | {
api | "line": 2,
api | "column": 3
api | }
api | ],
api | "extensions": {}
api | }
api |
api | π₯ Error Stack
api |
api | PrismaClientUnknownRequestError:
api | Invalid `db.post.findMany()` invocation in
api | D:\GitHub\cs490-hw2\api\src\services\posts\posts.js:4:18
api |
api | 1 import { db } from 'src/lib/db'
api | 2
api | 3 export const posts = () => {
api | β 4 return db.post.findMany(
api | Operation 'findMany' for model 'post' does not match any query.
api | at vn.handleRequestError (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:123:6902)
api | at vn.handleAndLogRequestError (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:123:6119)
api | at vn.request (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:123:5839)
api | at async l (D:\GitHub\cs490-hw2\node_modules\@prisma\client\runtime\library.js:128:9763)
api | at async D:\GitHub\cs490-hw2\node_modules\@graphql-tools\executor\cjs\execution\promiseForObject.js:18:35
api | at async Promise.all (index 0)
api |
api | 00:57:10 π Processing GraphQL Parameters done.
This error happens when I try to access the generated scaffold through the local host website (http://localhost:8910/posts).
Currently I am using node version 18.17.1, yarn version 1.22.19, windows 10, and RW was created for javaScript.
I have tried to make the same calls in a linux VM and it worked, but for some reason it does not work on windows.
These are the calls that I have made to reproduce the error:
$ yarn create redwood-app /PATH
$ cd path
$ yarn rw dev
//inside vsCode make the changes to the schema file
$ yarn rw prisma migrate dev
$ yarn rw g scaffold post
//check the webpage
//error appears on terminal
schema file after changes:
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = "native"
}
model Post {
id Int @id @default(autoincrement())
title String
body String
createdAt DateTime @default(now())
}
Web page: