James
12/18/2021, 12:51 AMwrangler pages dev
, or live? The experience for debugging Pages functions isn't perfect yet, but if you can share your repo, hopefully we can spot something 😄Fredthedoggy
12/18/2021, 12:51 AMFredthedoggy
12/18/2021, 12:51 AMFredthedoggy
12/18/2021, 12:51 AMFredthedoggy
12/18/2021, 12:51 AMFredthedoggy
12/18/2021, 12:51 AMfunctions/api
folderFredthedoggy
12/18/2021, 12:52 AMdetails.ts
filerichardwong
12/18/2021, 6:52 AMjsc8
in function, it won't work.richardwong
12/18/2021, 6:52 AMrichardwong
12/18/2021, 6:53 AMwrangler 0.0.0-beta.6
richardwong
12/18/2021, 6:53 AMrichardwong
12/18/2021, 6:53 AMpxkq
12/18/2021, 8:21 AM--proxy
pxkq
12/18/2021, 8:21 AMrichardwong
12/18/2021, 10:43 AMrichardwong
12/18/2021, 10:44 AMwrangler pages dev ./dist --proxy=3000
richardwong
12/18/2021, 10:44 AMjsc8
is compiled in this demo https://github.com/Macrometacorp/tutorial-cloudflare-bookstore
richardwong
12/18/2021, 10:45 AMrequire('path')
cause the error, but why this old worker-sites demo workspxkq
12/18/2021, 10:57 AMtutorial-cloudflare-bookstore
or jsc8
, but from its dependencies it looks like nodejs to me, and as far as I know cloudflare workers don't support that.
Are you able to run tutorial-cloudflare-bookstore
yourself?richardwong
12/18/2021, 11:25 AMMrBBot
12/18/2021, 3:05 PMtype = "webpack"
Wrangler project. This uses Webpack 4 to bundle the code which automatically polyfills Node.js built-in modules like path
. Pages functions uses esbuild for bundling instead which doesn't do this by default. Afaik, pages doesn't let you customise this, unless you use advanced mode: https://developers.cloudflare.com/pages/platform/functions#advanced-mode.Fredthedoggy
12/18/2021, 3:30 PMFredthedoggy
12/18/2021, 3:30 PMSkye
12/18/2021, 6:16 PMHardAtWork
12/18/2021, 6:21 PMSkye
12/18/2021, 6:22 PMSkye
12/18/2021, 6:23 PMWalshy | Pages
12/18/2021, 6:23 PMSkye
12/18/2021, 6:23 PMSkye
12/18/2021, 8:51 PM20:46:28.467 Compiling worker to "/opt/pages/functions/user-worker.js"
20:46:28.477 Finished in 42ms.