When setting the context type to .ts I get a comp...
# orm-help
i
When setting the context type to .ts I get a complaint every time there's a query, since when the project is built the types files is a .js file. But if I use the path of a .js file when starting the prisma client it complains for the opposite reason, any ideas?
Copy code
contextType: {
		module: join(__dirname, "types.ts"),
		export: "Context",
		alias: "ctx"
	}
r
Hey @Isidoro Ferreiro 👋 That mostly is a warning and shouldn’t affect the output/functionality of your code as the
contextType
is just used to get typings for the Context in the resolvers. What is the current setup that you’re facing this on?
i
When running locally Prisma reads the types file from the src folder, but should it be looking at the compiled file that’s generated after building the project?
r
In this case it’s not Prisma that’s reading the Context type from the folder but it’s Nexus in this case. It cannot look at the compiled file because that wouldn’t have any type information present to add to the context. The type info would only be present in
.ts
files.
i
But when we deploy only the compiled files are deployed, so what’s the point?
r
This will only occur in development and not in production. To make this warning go away, set your
NODE_ENV
to
production
.
👍 1