cometkim / vite-plugin-relay-lite

Vite plugin for more convenient Relay experience.
MIT License
45 stars 6 forks source link

Vite 6.0 compatibility #199

Closed hanford closed 7 hours ago

hanford commented 9 hours ago

Hello! me again :)

I've tried upgrading my applications to Vite 6.0 but I'm getting the following error:

[vite] Internal server error: graphql: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`. Note also that there cannot be a space between graphql and the backtick that follows.
app                                          |       at invariant (/Users/hanford/Developer/app2/node_modules/.pnpm/invariant@2.2.4/node_modules/invariant/invariant.js:40:15)
app                                          |       at graphql (/Users/hanford/Developer/app2/node_modules/.pnpm/relay-runtime@18.0.0/node_modules/relay-runtime/lib/query/GraphQLTag.js:7:52)
app                                          |       at eval (/Users/hanford/Developer/app2/packages/design-system/hooks/useForethought.tsx:21:36)
app                                          |       at ESModulesEvaluator.runInlinedModule (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1053:5)
app                                          |       at SSRCompatModuleRunner.directRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1279:61)
app                                          |       at SSRCompatModuleRunner.directRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:30612:23)
app                                          |       at SSRCompatModuleRunner.cachedRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1174:76)
app                                          |       at eval (/Users/hanford/Developer/app2/packages/components/src/AuthenticatedUser/index.tsx:12:31)
app                                          |       at ESModulesEvaluator.runInlinedModule (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1053:5)
app                                          |       at SSRCompatModuleRunner.directRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1279:61)
app                                          |       at SSRCompatModuleRunner.directRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:30612:23)
app                                          |       at SSRCompatModuleRunner.cachedRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1174:76)
app                                          |       at eval (/Users/hanford/Developer/app2/apps/app/app/root.tsx:9:31)
app                                          |       at ESModulesEvaluator.runInlinedModule (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1053:5)
app                                          |       at SSRCompatModuleRunner.directRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/module-runner.js:1279:61)
app                                          |       at SSRCompatModuleRunner.directRequest (file:///Users/hanford/Developer/app2/node_modules/.pnpm/vite@6.0.2_@types+node@20.10.4/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:30612:23)

which implies that the transform isn't being run. I'm not sure if this is known or not, but I'll spend some time over the next couple of days creating a repro.

cometkim commented 9 hours ago

Huh, thanks for reporting. I'll try myself tomorrow

cometkim commented 9 hours ago

Can you share the pnpm why graphql result?

hanford commented 8 hours ago

pnpm why graphql result

(I'm in a very large monorepo)

I'm also working on a repro now, will share it soon

hanford commented 7 hours ago

Hmmm, seems to be working in my repro. Sorry for the false alarm!

hanford commented 7 hours ago

Yep, user error. My bad!