Issue with Opennext Cloudflare
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js, postgresql
Hướng nghiên cứu
Trước tiên, hãy tái hiện lỗi bằng npm run preview và kiểm tra pg/lib/stream.js cùng với pg-cloudflare/package.json. Báo cáo đề cập đến stream.ts và entry ./dist/index.js bị thiếu, nhưng không xác định cách khắc phục dự kiến. Công việc được xem là hoàn tất khi bản build OpenNext Cloudflare không còn thất bại trong lúc resolve pg-cloudflare.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Thank you so much for all the effort you’ve put into this. I am currently trying to integrate with OpenNext Cloudflare, but I’m encountering an error in the stream.ts file due to a missing index.js file in the pg-cloudflare package.
I have tried looking into the package and found in export there is default and workerd. Somehow it not working on nextjs.
Here is the error:
himanshu@Himanshus-MacBook-Pro mathlive % npm run preview
> mathlive@0.1.0 preview
> cloudflare && wrangler dev
Building the Next.js app in the current folder (/Users/himanshu/Desktop/experiments/mathlive)
▲ Next.js 14.2.5
- Environments: .env
Creating an optimized production build ...
Webpack Bundle Analyzer saved report to /Users/himanshu/Desktop/experiments/mathlive/.next/analyze/nodejs.html
No bundles were parsed. Analyzer will show only original module sizes from stats file.
Webpack Bundle Analyzer saved report to /Users/himanshu/Desktop/experiments/mathlive/.next/analyze/edge.html
Webpack Bundle Analyzer saved report to /Users/himanshu/Desktop/experiments/mathlive/.next/analyze/client.html
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (7/7)
✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ƒ / 141 B 87.2 kB
├ ○ /_not-found 871 B 87.9 kB
├ ○ /api 0 B 0 B
└ ○ /mathlive 141 B 87.2 kB
+ First Load JS shared by all 87 kB
├ chunks/23-b75664ace61c0abb.js 31.5 kB
├ chunks/fd9d1056-2821b0f0cabcd8bd.js 53.6 kB
└ other shared chunks (total) 1.86 kB
○ (Static) prerendered as static content
ƒ (Dynamic) server-rendered on demand
⚙️ Copying files...
# copyPrerenderedRoutes
# copyPackageTemplateFiles
⚙️ Bundling the worker file...
# patchWranglerDeps
# updateWebpackChunksFile
- chunk 347.js
- chunk 621.js
- chunk 682.js
- chunk 948.js
# patchRequire
# patchReadFile
# inlineNextRequire
# patchFindDir
# inlineEvalManifest
# patchCache
# inlineMiddlewareManifestRequire
# patchExceptionBubbling
Worker saved in `/Users/himanshu/Desktop/experiments/mathlive/.worker-next/index.mjs` 🚀
⛅️ wrangler 3.92.0
-------------------
Your worker has access to the following bindings:
- Vars:
- ENVIRONMENT: "development"
- DB_URL: "postgresql://postgres:bMOqlzxMfjbcJAr..."
[wrangler:inf] Ready on http://localhost:8787
✘ [ERROR] Build failed with 1 error:
✘ [ERROR] Could not resolve "pg-cloudflare"
.worker-next/.next/standalone/node_modules/pg/lib/stream.js:41:41:
41 │ const { CloudflareSocket } = require('pg-cloudflare')
╵ ~~~~~~~~~~~~~~~
The module "./dist/index.js" was not found on the file system:
.worker-next/.next/standalone/node_modules/pg-cloudflare/package.json:13:15:
13 │ "workerd": "./dist/index.js",
╵ ~~~~~~~~~~~~~~~~~
You can mark the path "pg-cloudflare" 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.
🪵 Logs were written to "/Users/himanshu/Library/Preferences/.wrangler/logs/wrangler-2024-12-06_08-27-37_958.log"
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open devtools, [l] turn off local mode, [c] clear console, [x] to exit │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
himanshu@Himanshus-MacBook-Pro mathlive %
--- 2024-12-06T08:27:38.038Z debug
🪵 Writing logs to "/Users/himanshu/Library/Preferences/.wrangler/logs/wrangler-2024-12-06_08-27-37_958.log"
---
--- 2024-12-06T08:27:38.038Z log
⛅️ wrangler 3.92.0
[38;2;255;136;0m-------------------[39m
---
--- 2024-12-06T08:27:38.123Z debug
.env file not found at "/Users/himanshu/Desktop/experiments/mathlive/.dev.vars". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---
--- 2024-12-06T08:27:38.123Z log
Your worker has access to the following bindings:
- Vars:
- ENVIRONMENT: "development"
- DB_URL: "postgresql://postgres:bMOqlzxMfjbcJAr..."
---
--- 2024-12-06T08:27:38.308Z debug
Error in BundlerController: Failed to construct initial bundle
BuildFailure [Error]: Initial build failed.
at bundleWorker (/Users/himanshu/Desktop/experiments/mathlive/node_modules/wrangler/wrangler-dist/cli.js:129371:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async build (/Users/himanshu/Desktop/experiments/mathlive/node_modules/wrangler/wrangler-dist/cli.js:136691:59) {
errors: [
{
detail: undefined,
id: '',
location: [Object],
notes: [Array],
pluginName: '',
text: 'Could not resolve "pg-cloudflare"'
}
],
warnings: []
}
---
- Ngôn ngữ chính
- JavaScript
- Star
- 13.2k
- Fork
- 1.4k
- Merge trung bình
- 6 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của brianc/node-postgres
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
brianc/node-postgres#3770 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
brianc/node-postgres#3716 · 1 bình luận ·
-
# remove bring your own promise Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
brianc/node-postgres#3631 · 1 bình luận ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 62/100
brianc/node-postgres#2857 ·
-
can't view docs for old versions Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
brianc/node-postgres#2433 ·
Tất cả issue của brianc/node-postgres
Issue tương tự
-
Update HugeIcons library Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
antfu-collective/icones#398 ·
-
ECmail.com Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
wesbos/burner-email-providers#554 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
components-web-app/docs#92 ·