workers-sdk: Project build not works

Hello, I’ve tried following build process, but it just keep showing logs with build command

$ npm run build            

> wrangler-root@0.0.0 build /Users/kination/workspace/oss/wrangler2
> npm run build --workspace=wrangler

> wrangler-root@0.0.0 build /Users/kination/workspace/oss/wrangler2
> npm run build --workspace=wrangler

> wrangler-root@0.0.0 build /Users/kination/workspace/oss/wrangler2
> npm run build --workspace=wrangler

> wrangler-root@0.0.0 build /Users/kination/workspace/oss/wrangler2
> npm run build --workspace=wrangler
...
...

Am I doing correctly, or missing something?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (27 by maintainers)

Most upvoted comments

Ok I see what’s happening here. You need to create a workers.dev subdomain on the dashboard. Go to dash.cloudflare.com, choose Workers in the left sidebar, and you should see a UI to set your workers subdomain in the right sidebar.

Some follow up notes for us -

  • wrangler 1 had a command to set this subdomain from the command line. I dunno whether we should have it on Wrangler 2.
  • I do think we should make users register a subdomain when they make a Cloudflare account
  • in any case, we should handle this error better in the cli, and have messaging that asks a user to create a subdomain for workers.dev

I’m going to reopen this issue, and we’ll edit the title to reflect the problem and assign to someone to fix it later.

Thank you for helping us find this, appreciate your patience!

Closing as Wrangler appears to be working as expected, and this issue is turning into a mix of different resolved problems. @djKooks - Please open a new issue with any new problems you encounter.

This is as expected, we setup a proxy locally to access via localhost, but the actual worker is running on the edge. You can hit L to run the worker locally as well.

Could you try with the latest beta? I think this was a problem with 0.0.8. Install wrangler@beta and see if this still occurs?

The requirement for >= 16.7.0 comes from Miniflare, which makes extensive use of new Web Standards added in recent versions of Node.js (Web Streams, crypto, Blob, EventTarget, etc). The most recent thing Miniflare uses is the stream/consumers module, which was added in 16.7.0.