cloudflare / cloudflare/workers-aws-template

Unable to generate project OR bundle the code in this repo

Open
#8 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
128
Forks
10
PR merge metrics
No merged PRs in 30d

Description

```
λ´wrangler generate projectname https://github.com/cloudflare/workers-aws-template
⛅️ wrangler 2.1.15 (update available 2.6.0)
------------------------------------------------------
Creating a worker in projectname from https://github.com/cloudflare/workers-aws-template

✘ [ERROR] Failed to find "undefined" in https://github.com/cloudflare/workers-aws-template.git

If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose
```

If i clone this repo and attempt to run the code directly

```
λ´wrangler dev index.js
⛅️ wrangler 2.1.15 (update available 2.6.0)
✘ [ERROR] Could not resolve "http2"

node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js:6:24:
6 │ const http2_1 = require("http2");
╵ ~~~~~~~

The package "http2" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Build failed with 1 error:

node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js:6:24: ERROR: Could not
resolve "http2"
```

I see this exact error in a project where i'm trying to use dynamo from a worker.

Contributor guide

Open the contributing guide

Research direction

Reproduce both reported entry points: `wrangler generate projectname https://github.com/cloudflare/workers-aws-template` and `wrangler dev index.js`. Inspect `node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js` and the template entry point to understand the `undefined` lookup and `http2` resolution failures. Done means the project generates and the worker bundles with the AWS SDK without either error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, node.js
Domain
build-system, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.