paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
684 stars 54 forks source link

2.2.1 TypeError: Cannot read property 'run' of undefined #135

Closed carlosfiori closed 3 years ago

carlosfiori commented 3 years ago

I'm trying upgrade from 1.6.1 to 2.2.1 but I'm getting this error when run pal generate: TypeError: Cannot read property 'run' of undefined

and when i downgrade back to 1.6.1 it started to throw this error: TypeError: Cannot read property '0' of undefined, in this case looks like is not reading the schema file

Which more info I can provide to help? I can not find a debug mode

AhmedElywa commented 3 years ago

@carlosfiori Thanks for reporting, Can you please provide what is your prisma client version? And are you read the releases notes there are many breaking changes like nexus-schema generator renamed to nexus because we dropped the nexus framework

AhmedElywa commented 3 years ago

also all versions before 2.0.0 need prisma version <= 2.7.0 all versions after 2.0.0 need prisma version >= 2.8.0

carlosfiori commented 3 years ago

I'm trying to rollback with prisma version 2.7.0 and paljs 1.7.0


$ prisma generate && npx pal g && yarn generate:nexus
Environment variables loaded from prisma/.env

✔ Generated Prisma Client (version: 2.7.0) to ./node_modules/@prisma/client in 180ms

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')

const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client
◢ Generating your files    TypeError: Cannot read property '0' of undefined`
carlosfiori commented 3 years ago

I read the releases notes for 1.6.0 and their say that requires Prisma 2.8.0 So I tried now with paljs 1.5.6 and prisma 2.7.0 but same error

AhmedElywa commented 3 years ago

Can you try to use the last pal.js version 2.2.1 and prisma version 2.8.1?

carlosfiori commented 3 years ago

I retry with pal.js 2.2.1 and prisma 2.8.1 and it works. I probably get some version wrong first time and definitely not changed the generator name to nexus.

Thanks for all your support and great work

AhmedElywa commented 3 years ago

Thanks to you. I will close this issue if you need any other help, please open a new one