Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Critical dependency: the request of a dependency is an expression #1489

Open
shadiramadan opened this issue Aug 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@shadiramadan
Copy link

What are you really trying to do?

I'm trying to build / run a Next.js application without any warnings or errors. I am only using the @temporalio/client to be able to Signal workflows.

Describe the bug

I have a server-only file that imports the client:

import { Client, Connection } from "@temporalio/client";

The client is used in some server side logic. When running next as a build or in dev mode (and loading a page that references the import). I get the following error:

./node_modules/.pnpm/@[email protected]/node_modules/@temporalio/common/lib/internal-non-workflow/data-converter-helpers.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/.pnpm/@[email protected]/node_modules/@temporalio/common/lib/internal-non-workflow/data-converter-helpers.js
./node_modules/.pnpm/@[email protected]/node_modules/@temporalio/common/lib/internal-non-workflow/index.js
./node_modules/.pnpm/@[email protected]/node_modules/@temporalio/client/lib/async-completion-client.js
./node_modules/.pnpm/@[email protected]/node_modules/@temporalio/client/lib/index.js
./src/lib/temporal.ts
./src/lib/auth/index.ts
./src/app/[locale]/layout.tsx

Minimal Reproduction

Load the temporal client on the server side.

Environment/Versions

OS: MacOS Sonoma 14.5 (23F79)
Package: "@temporalio/client": "^1.10.3",
Node: v20.16.0

Additional context

My signal workflow logic works fine. The error also occurs in a linux based docker image.

@shadiramadan shadiramadan added the bug Something isn't working label Aug 7, 2024
@shadiramadan
Copy link
Author

Possibly related #1292

@mjameswh
Copy link
Contributor

Possibly related 1292

That touches the same part of the code, but the use case is very different.

Implementing #1458 is certainly part of the solution, but I'm afraid that will not be enough to avoid the build error people are seeing when bundling the client.

@shadiramadan
Copy link
Author

@mjameswh Do you know how to work around this error in the temporal client or is it unavoidable at this time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants