Feature Request: Support --node-compat in wrangler pages build
See original GitHub issueWhat version of Wrangler
are you using?
2.0.6 or beta
What operating system are you using?
Mac
Describe the Bug
App was rewrited from CRA to Remix and i’ve moved all config from Remix Cloudflare Pages template where it works to my project where i get that error
I’ve tried to use versions: beta
and 2.0.6
doesn’t work on both of them.
commands that i’ve used:
"dev": "remix build && run-p dev:*",
"dev:remix": "remix watch",
"dev:wrangler": "cross-env NODE_ENV=development wrangler pages dev ./public",
Error:
[pages:err] ReferenceError: Buffer is not defined
at /Repos/app-partners-remix/functions/[[path]].js:10:47417
at /Repos/app-partners-remix/functions/[[path]].js:1:822
at /Repos/app-partners-remix/functions/[[path]].js:10:67472
at /Repos/app-partners-remix/functions/[[path]].js:1:822
at /Repos/app-partners-remix/functions/[[path]].js:10:103675
at /Repos/app-partners-remix/functions/[[path]].js:1:822
at /Repos/app-partners-remix/functions/[[path]].js:10:106256
at /Repos/app-partners-remix/functions/[[path]].js:1:822
at /Repos/app-partners-remix/functions/[[path]].js:329:99451
at SourceTextModule.evaluate (node:internal/vm/module:224:23)
✘ [ERROR] Could not start Miniflare.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "dev:wrangler" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Edit: I found out package @emotion/server/create-instance
is responsible for that bug, without it wrangler works.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Configuration · Cloudflare Workers docs
Configures a custom build step to be run by Wrangler when building your Worker. Refer to Custom builds. no_bundle boolean optional. Skip ...
Read more >Using the CLI - Miniflare
The CLI is the easiest way to get started with Miniflare. It lets you start a local HTTP server that serves requests using...
Read more >@sveltejs/adapter-cloudflare-workers - npm
Wrangler v1 is no longer supported. Comparisons. adapter-cloudflare – supports all SvelteKit features; builds for Cloudflare Pages ...
Read more >cloudflare/wrangler2 wrangler@0.0.28 on GitHub
Patch Changes. #843 da12cc5 Thanks @threepointone! - fix: site.entry-point is no longer a hard deprecation. To make migration of v1 projects easier, Sites...
Read more >Hosting Next.js at the edge with Cloudflare Pages
It includes hybrid static & server rendering, TypeScript support, smart bundling, ... "wrangle": "next build && next export && npx wrangler pages dev...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is not a perfect solution since it doesn’t work in production just yet, so I wouldn’t recommend using it
@jagu-sayan Sharing some of my knowledge here to help save you and others the time that I’ve spent.
I had some discussions in Discord and was encouraged by a moderator to make this PR: https://github.com/cloudflare/wrangler2/pull/1857
The reviewer rejected it and gave a vague response that they want to “tackle this slightly differently”. No idea where node compatibility sits on their roadmap.
You can see some steps here which might work in theory, however did not work the same as in local dev for me: https://discord.com/channels/595317990191398933/910978223968518144/1016371495968182362
I’m just going to continue paying Netlify until a competitor provides a solution that works.