Hi Prisma Family :prisma: - I’ve been running into...
# orm-help
c
Hi Prisma Family prisma - I’ve been running into issues getting a Next.js + Prisma + Graphql + TypeScript project to a stable point. I don’t think the issue I am now running into is Prisma related but figured I would ask in hopes someone might be able to help. I’ve created a CodeSandbox where you can see everything I have setup so far and the error in the screenshot. Any help is much appreciated 🙏
r
@Chris Baucom 👋 Not sure, but seems like an issue with your
.babelrc
. Is this the default that Next.js provides or have you added anything extra?
c
Copy code
// .babelrc
{
  "presets": ["next/babel"],
  "plugins": [
    "babel-plugin-transform-typescript-metadata",
    ["@babel/plugin-proposal-decorators", { "legacy": true }],
    ["@babel/plugin-proposal-class-properties", { "loose": true }]
  ]
}
Hey @Ryan if you can recall this thread from last week, I’ve got my Babel file set as shown above. https://prisma.slack.com/archives/CKQTGR6T0/p1621890162218000
r
Your CodeSandbox has this extra in `.babelrc`:
Copy code
"babel-plugin-transform-es2015-modules-commonjs",
Comparing with what you’ve sent above, this is not required.
c
Ok yes thank you for pointing that out. Removing that line from
.babelrc
does seem to resolve that error. Now I am getting the following:
Copy code
ReferenceError: Cannot access 'ItemWhereInput' before initialization
    at Module.ItemWhereInput (<webpack-internal:///./graphql/generated/type-graphql/resolvers/inputs/ItemWhereInput.ts:3:55|webpack-internal:///./graphql/generated/type-graphql/resolvers/inputs/ItemWhereInput.ts:3:55>)
Not sure if you can see that in CodeSandbox or not but I see it in my local dev server console
Here is the same code in CodeSandbox in a GH repo if anyone can help try locally. It seems my graphql endpoint is no longer working when removing the
"babel-plugin-transform-es2015-modules-commonjs"
line in
.babelrc