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] [ERROR] Could not resolve "uuid" #223

Open
gethassaan opened this issue Jan 3, 2025 · 4 comments
Open

[BUG] [ERROR] Could not resolve "uuid" #223

gethassaan opened this issue Jan 3, 2025 · 4 comments
Labels
bug Something isn't working triage

Comments

@gethassaan
Copy link

gethassaan commented Jan 3, 2025

Describe the bug

.open-next/.next/standalone/node_modules/@smithy/middleware-retry/dist-cjs/index.js:51:26: 51 │ var import_uuid = require("uuid");

The module "./dist/commonjs-browser/index.js" was not found on the file system:

.open-next/.next/standalone/node_modules/@smithy/middleware-retry/node_modules/uuid/package.json:34:19: 34 │ "require": "./dist/commonjs-browser/index.js"


You can mark the path "uuid" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.

### Steps to reproduce

1. clone [email protected]:gethassaan/opennextjs-cloudflare-uuid-issue.git
2. add cloudflare credentials in `.env.local`
3. npm run preview

### Expected behavior

Preview / deployment should not fail with the `uuid` error and build should run smoothly.

### @opennextjs/cloudflare version

0.3.3

### Wrangler version

3.99.0

### next info output

```shell
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.2.0: root:xnu-11215.61.5~2/RELEASE_ARM64_T8103
Available memory (MB): 16384
Available CPU cores: 8
Binaries:
Node: 22.9.0
npm: 10.9.0
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 15.1.3 // Latest available version is detected (15.1.3).
eslint-config-next: 15.1.3
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.2
Next.js Config:
output: N/A
```


### Additional context

The build completes without any errors for me, but when I try to deploy or run the preview using `wrangler deploy` or `wrangler dev --port 8771` it thorws an error of `Could not resolve "uuid"`.
@gethassaan gethassaan added bug Something isn't working triage labels Jan 3, 2025
@gethassaan gethassaan changed the title [BUG] [ERROR] Build failed with 1 error: [ERROR] Could not resolve "uuid" [BUG] [ERROR] Could not resolve "uuid" Jan 3, 2025
@allentv
Copy link

allentv commented Jan 5, 2025

Running into the same problem too. Hence the upvote

@vicb
Copy link
Contributor

vicb commented Jan 5, 2025

including a repro as a github repo that we can clone and investigate would help speed up the investigation.
Thanks

@gethassaan
Copy link
Author

gethassaan commented Jan 5, 2025

hey @vicb, I have updated the bug description and I have included the example in this repo

@vicb
Copy link
Contributor

vicb commented Jan 5, 2025

Thanks, I'll take a look this week.
One thing you can try is this

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

No branches or pull requests

3 participants