You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The job is enqueued, but this warning is shown in the console:
[22:10:45.274] WARN (next.js/1652545): ./node_modules/graphile-worker/node_modules/cosmiconfig/dist/loaders.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/graphile-worker/node_modules/cosmiconfig/dist/loaders.js
./node_modules/graphile-worker/node_modules/cosmiconfig/dist/index.js
./node_modules/graphile-worker/dist/config.js
./node_modules/graphile-worker/dist/preset.js
./node_modules/graphile-worker/dist/index.js
./src/app/api/test-worker/route.ts
prefix: "warn"
Additional context
I tried modifying my Next.js config as suggested in #345:
I think the solution for this would be to add "exports" to package.json and then export a subpath for WorkerUtils ("exports": {"./utils": {...}}) that does not need to contain any of the dynamic task loading logic. Further, we should make a stripped down WorkerUtils that doesn't know how to run migrations (since that also loads files). You'll still have issues bundling it since the pg library attempts to load pg-native, but this'll help.
Alternatively, just use the Next configuration to stub out all the problematic parts that you don't need.
@chrboe you ever find a solution you like for this? I'm hitting the exact same problem trying to integrate graphile-worker with typescript tasks into a typescript-based next.js app.
Summary
When including Graphile Worker in a Next.js project, dependency warnings are thrown.
Steps to reproduce
Expected results
The job gets enqueued.
Actual results
The job is enqueued, but this warning is shown in the console:
Additional context
I tried modifying my Next.js config as suggested in #345:
But that only partly solved the issue. There were more warnings displayed before changing the config, though.
Possible Solution
I suspect there is some way to exclude a certain module to make the warnings go away, but nothing I have tried has worked so far.
The text was updated successfully, but these errors were encountered: