Bug description
npx prisma generate fails with TypeError: Cannot read property 'filter' of undefined
How to reproduce
Repro on CentOS 8:
- Download starter project from Quickstart with Typescript.
curl -L https://pris.ly/quickstart | tar -xz --strip=2 quickstart-master/typescript/starter
- Download and extract binaries:
mkdir vendor-bins && cd vendor-bins \
&& wget https://binaries.prisma.sh/2.1.x/latest/debian-openssl-1.1.x/introspection-engine.gz \
https://binaries.prisma.sh/2.1.x/latest/rhel-openssl-1.1.x/migration-engine.gz \
https://binaries.prisma.sh/2.1.x/latest/rhel-openssl-1.1.x/prisma-fmt.gz \
https://binaries.prisma.sh/2.1.x/latest/rhel-openssl-1.1.x/query-engine.gz \
&& gunzip *.gz \
&& chmod +x ./* \
&& cd ..
- Set environment variables
export PRISMA_MIGRATION_ENGINE_BINARY="$PWD/vendor-bins/migration-engine" \
&& export PRISMA_QUERY_ENGINE_BINARY="$PWD/vendor-bins/query-engine" \
&& export PRISMA_INTROSPECTION_ENGINE_BINARY="$PWD/vendor-bins/introspection-engine" \
&& export PRISMA_FMT_BINARY="$PWD/vendor-bins/prisma-fmt"
- Install project
- Attempt to generate the client
$ DEBUG="*" npx prisma generate
prisma:tryLoadEnv Environment variables not found at null +0ms
prisma:tryLoadEnv Environment variables loaded from ./prisma/.env +2ms
Environment variables loaded from prisma/.env
download Using env var PRISMA_QUERY_ENGINE_BINARY for binary query-engine, which points to /home/kyle/starter/vendor-bins/query-engine +0ms
download Using env var PRISMA_MIGRATION_ENGINE_BINARY for binary migration-engine, which points to /home/kyle/starter/vendor-bins/migration-engine +1ms
download Using env var PRISMA_INTROSPECTION_ENGINE_BINARY for binary introspection-engine, which points to /home/kyle/starter/vendor-bins/introspection-engine +0ms
download Using env var PRISMA_FMT_BINARY for binary prisma-fmt, which points to /home/kyle/starter/vendor-bins/prisma-fmt +0ms
Prisma schema loaded from prisma/schema.prisma
prisma:download Using env var PRISMA_QUERY_ENGINE_BINARY for binary query-engine, which points to /home/kyle/starter/vendor-bins/query-engine +0ms
{ prismaClientDir: '/home/kyle/starter/node_modules/@prisma/client' }
prisma:download Using env var PRISMA_QUERY_ENGINE_BINARY for binary query-engine, which points to /home/kyle/starter/vendor-bins/query-engine +582ms
__dirname /home/kyle/starter/node_modules/@prisma/client/generator-build
/home/kyle/starter/node_modules/@prisma/client/generator-build
Error: Error:
TypeError: Cannot read property 'filter' of undefined
at getMappings (/home/kyle/starter/node_modules/@prisma/client/generator-build/index.js:75843:52)
at externalToInternalDmmf (/home/kyle/starter/node_modules/@prisma/client/generator-build/index.js:75839:15)
at getPrismaClientDMMF (/home/kyle/starter/node_modules/@prisma/client/generator-build/index.js:75873:10)
at buildClient (/home/kyle/starter/node_modules/@prisma/client/generator-build/index.js:73035:23)
at Object.generateClient (/home/kyle/starter/node_modules/@prisma/client/generator-build/index.js:73097:47)
at async LineStream.<anonymous> (/home/kyle/starter/node_modules/@prisma/client/generator-build/index.js:2802:26)
at Generate2.parse (/home/kyle/starter/node_modules/prisma/build/index.js:63971:17)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async main (/home/kyle/starter/node_modules/prisma/build/index.js:100809:18)
Expected behavior
Client generation completes without error.
Prisma information
Default setup from Quickstart with Typescript
Environment & setup
- OS: Linux x86_64 (Centos 8)
- Database: Likely db-independent, but verified with SQLite
- Node.js version: v14.15.4
- Prisma version:
$ DEBUG="*" npx prisma -v
prisma:tryLoadEnv Environment variables not found at null +0ms
prisma:tryLoadEnv Environment variables loaded from ./prisma/.env +2ms
Environment variables loaded from prisma/.env
download Using env var PRISMA_QUERY_ENGINE_BINARY for binary query-engine, which points to /home/kyle/starter/vendor-bins/query-engine +0ms
download Using env var PRISMA_MIGRATION_ENGINE_BINARY for binary migration-engine, which points to /home/kyle/starter/vendor-bins/migration-engine +1ms
download Using env var PRISMA_INTROSPECTION_ENGINE_BINARY for binary introspection-engine, which points to /home/kyle/starter/vendor-bins/introspection-engine +0ms
download Using env var PRISMA_FMT_BINARY for binary prisma-fmt, which points to /home/kyle/starter/vendor-bins/prisma-fmt +0ms
prisma : 2.17.0
@prisma/client : 2.17.0
Current platform : rhel-openssl-1.1.x
Query Engine : query-engine 363f5a521d6b06543e53d134652a0037a3096d41 (at vendor-bins/query-engine, resolved by PRISMA_QUERY_ENGINE_BINARY)
Migration Engine : migration-engine-cli 363f5a521d6b06543e53d134652a0037a3096d41 (at vendor-bins/migration-engine, resolved by PRISMA_MIGRATION_ENGINE_BINARY)
Introspection Engine : introspection-core 363f5a521d6b06543e53d134652a0037a3096d41 (at vendor-bins/introspection-engine, resolved by PRISMA_INTROSPECTION_ENGINE_BINARY)
Format Binary : prisma-fmt 363f5a521d6b06543e53d134652a0037a3096d41 (at vendor-bins/prisma-fmt, resolved by PRISMA_FMT_BINARY)
Studio : 0.353.0
prisma:cli TypeError: Cannot read property 'length' of undefined
prisma:cli at /home/kyle/starter/node_modules/prisma/build/index.js:100832:77
prisma:cli at Array.find (<anonymous>)
prisma:cli at main (/home/kyle/starter/node_modules/prisma/build/index.js:100832:43) +0ms
Bug description
npx prisma generatefails withTypeError: Cannot read property 'filter' of undefinedHow to reproduce
Repro on CentOS 8:
Expected behavior
Client generation completes without error.
Prisma information
Default setup from Quickstart with Typescript
Environment & setup