Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Wrangler generate project name requirements #470

Closed
exvuma opened this issue Aug 26, 2019 · 1 comment Β· Fixed by #686
Closed

Wrangler generate project name requirements #470

exvuma opened this issue Aug 26, 2019 · 1 comment Β· Fixed by #686
Assignees
Labels
feature Feature requests and suggestions

Comments

@exvuma
Copy link
Contributor

exvuma commented Aug 26, 2019

πŸ› Bug Report

Environment

  • operating system: OSX
  • output of rustc -V: rustc 1.36.0 (a53f9df32 2019-07-03)
  • output of wrangler -V: πŸ‘· ✨ wrangler 1.2.0

Steps to reproduce

wrangler generate myApp https://github.com/cloudflare/worker-template 
cd myApp
# config wrangler.toml
wrangler publish

What did you expect to see?

Wrangler generate should either:

  1. rename project names to Worker API accepted values
    OR
  2. reject the project name upon generate
    Instead one can successfully generate a project with a name not accepted by the API

What did you see instead?

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.

added 1 package in 1.181s
⬇️ Installing wranglerjs...
✨  Built successfully, built project size is 517 bytes.
Error: Something went wrong! Status: 400 Bad Request, Details {
  "result": null,
  "success": false,
  "errors": [
    {
      "code": 10016,
      "message": "workers.api.error.invalid_script_name"
    }
  ],
  "messages": []
}

Original discussion in cloudflare/cloudflare-docs#261

@gabbifish
Copy link
Contributor

We will check that a given worker name is valid by running it against the workers name regex, "^[a-z0-9_][a-z0-9-_]*$". cc @ashleygwilliams @ashleymichal

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants