Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: worker-speedtest template can't be deployed #5830

Open
nielsreijers opened this issue May 15, 2024 · 0 comments 路 May be fixed by #5840
Open

馃悰 BUG: worker-speedtest template can't be deployed #5830

nielsreijers opened this issue May 15, 2024 · 0 comments 路 May be fixed by #5840
Labels
bug Something that isn't working

Comments

@nielsreijers
Copy link

Which Cloudflare product(s) does this pertain to?

Workers for Platforms

What version(s) of the tool(s) are you using?

鉀咃笍 wrangler 3.56.0

What version of Node are you using?

v20.10.0

What operating system and version are you using?

Fedora 39

Describe the Bug

Observed behavior

Running npm create cloudflare@latest my-app -- --template cloudflare/workers-sdk/templates/worker-speedtest as described in the Quickstarts results in a project that can't be deployed.

Expected behavior

I expect the code generated by the template to be in a state where it can be deployed.

Steps to reproduce

Please provide the following:
Run npm create cloudflare@latest my-app -- --template cloudflare/workers-sdk/templates/worker-speedtest and as it to deploy the worker.

The reason is that packages.json wants to deploy src/index.js, while the template contains src/index.ts. It seems this was refactored at some point from .js to .ts without updating packages.json?

After fixing this and other references to .js files in the code, npm run deploy worked and deployed the worker.

However searching through the source for other occurrences of .js, showed that the test code also still referred to javascript files, so npm run test failed, and simply changing that to .ts still left some errors.

So I think that makes this a bit more than a trivial change, which is why I'm opening this issue instead of opening a PR directly.
I'll send a PR to fix both the deploy issue and the unit tests later today or tomorrow.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@nielsreijers nielsreijers added the bug Something that isn't working label May 15, 2024
nielsreijers added a commit to nielsreijers/workers-sdk that referenced this issue May 15, 2024
The code had been converted to typescript in 026d944, but packages.json and several other places still refered to .js files.

In addition a refactoring of the test code meant tests for both /up and /down urls were now being sent to the handler for /up, causing the tests to fail. I removed some of the test in up.test.ts since they were testing different values of the ?bytes= parameter, but this parameter is only used in down.ts, not in up.ts.
@nielsreijers nielsreijers linked a pull request May 15, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Untriaged
Development

Successfully merging a pull request may close this issue.

1 participant