Skip to content

require function is used in a way in which dependencies cannot be statically extracted #345

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

Open
jparismorgan opened this issue Mar 21, 2025 · 1 comment
Assignees

Comments

@jparismorgan
Copy link

Hi there, I have a Next.js project with "replicate": "^1.0.1", and this code:

import Replicate from 'replicate'

export const replicate = new Replicate({
  auth: process.env.REPLICATE_API_KEY
})

I'm seeing this warning during local development:

- warn ../../node_modules/replicate/lib/util.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Import trace for requested module:
../../node_modules/replicate/lib/util.js
../../node_modules/replicate/index.js
./src/lib/replicate.ts
./src/app/api/cloud/image/route.ts

from const ApiError = require("./error"); in node_modules/replicate/lib/util.js.

Any suggestions on preventing this?

@ntgussoni
Copy link

ntgussoni commented May 23, 2025

I'm having the same issues as well, let me know if you guys need help testing it

EDIT: v1.1.0-0

This one removes the warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants