workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: missing entry-point

Open heyjorgesilva opened this issue 3 years ago • 3 comments

What version of Wrangler are you using?

2.0.29

What operating system are you using?

Mac

Describe the Bug

✘ [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. wrangler dev path/to/script) or the main config field

heyjorgesilva avatar Sep 07 '22 01:09 heyjorgesilva

I think I've seen something similar before, Could you describe your project's file structure? Specifically, the layout of all your files, where your package,json is, and which folder you run wrangler dev in

threepointone avatar Sep 07 '22 10:09 threepointone

same bug https://postimg.cc/Mfj9tqW7 X [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. wrangler dev path/to/script) or the main config field.

followed this tutorial as well export default { fetch() { return new Response('hello world') } } npx wrangler dev .\index.js

ran into some error X [ERROR] Build failed with 1 error:

index.js:1:0: ERROR: Unexpected "\xff"

⛅️ wrangler 2.0.29

Welcome to Node.js v16.17.0. Type ".help" for more information.

What operating system are you using? Windows

foreverlate avatar Sep 07 '22 16:09 foreverlate

same bug https://postimg.cc/Mfj9tqW7 X [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. wrangler dev path/to/script) or the main config field.

followed this tutorial as well export default { fetch() { return new Response('hello world') } } npx wrangler dev .\index.js

ran into some error X [ERROR] Build failed with 1 error:

index.js:1:0: ERROR: Unexpected "\xff"

⛅️ wrangler 2.0.29

Welcome to Node.js v16.17.0. Type ".help" for more information.

What operating system are you using? Windows

It looks like you may have added a Unicode xFF right before the export default which is shown by the question marks symbols.

JacobMGEvans avatar Sep 07 '22 17:09 JacobMGEvans

Hey 👋 ! We haven't heard from you about this so we are going to close this. If you have further clarification on this please feel free to reopen this, or open another issue with some more details

cameron-robey avatar Sep 26 '22 15:09 cameron-robey

Facing same issue. @cameron-robey kindly reopen the issue.

soumendrak avatar Jan 19 '23 16:01 soumendrak

Facing same issue at https://developers.cloudflare.com/workers/tutorials/workers-kv-from-rust/#using-the-wrapper

harunobukameda20211109 avatar Feb 04 '23 04:02 harunobukameda20211109

facing same issue still...

tapanjo92 avatar Feb 24 '23 09:02 tapanjo92

Same issue in a CI monorepo.

enricopolanski avatar Nov 06 '23 21:11 enricopolanski

I had the same issue, but I had "wrangler dev" running on another terminal, closing the other terminal fixed it for me.

ParardhaSarmah avatar Nov 12 '23 16:11 ParardhaSarmah

Same issue for me in a simple github actions (monorepo with pnpm workspaces)

Kalo0m avatar Dec 17 '23 22:12 Kalo0m

Same issue, please reopen. running wranger dev in monorepo workspace fails wit this error.


--- 2024-01-04T01:07:38.562Z debug
🪵  Writing logs to "/Users/redacted/Library/Preferences/.wrangler/logs/wrangler-2024-01-04_01-07-38_504.log"
---

--- 2024-01-04T01:07:38.562Z log
 ⛅️ wrangler 3.22.2
[38;2;255;136;0m-------------------[39m
---

--- 2024-01-04T01:07:38.565Z log

---

--- 2024-01-04T01:07:38.587Z error
[31m✘ [41;31m[[41;97mERROR[41;31m][0m [1mMissing entry-point: The entry-point should be specified via the command line (e.g. `wrangler dev path/to/script`) or the `main` config field.[0m


---

--- 2024-01-04T01:07:38.587Z log
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m
---

--- 2024-01-04T01:07:41.494Z debug
Sentry: Capturing exception Error: Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler dev path/to/script`) or the `main` config field.
---

0xalecks avatar Jan 04 '24 01:01 0xalecks

Facing the same issue

jamal7887 avatar Jan 08 '24 10:01 jamal7887

I've faced the same issue, but the reason was quite simple. ✅ I just had to cd to the directory with cloudflare app, and everything worked fine

thatkit avatar Jan 09 '24 02:01 thatkit

Usually this message surfaces when Wrangler can't detect the entry-point for your Worker, which should be specified either on the command line when running Wrangler:

wrangler dev index.ts

or in Wrangler's config file:

# wrangler.toml
main = "index.ts"

If you've specified either of those options and Wrangler still surfaces the message about a missing entrypoint, please open a new issue with a minimal reproduction and we can investigate further.

penalosa avatar Jan 09 '24 12:01 penalosa

Had the same problem. Ended up creating worker in Cloudflare dashboard and then initialising locally.

  1. npm install -g wrangler

  2. wrangler login

  3. wrangler init --from-dash your-random-worker-name

This creates all local dependencies and setup.

Then cd into your project dir (your-random-worker-name) and run npm run start

Profit!

ernests avatar Jan 11 '24 17:01 ernests

I've faced the same issue, but the reason was quite simple. ✅ I just had to cd to the directory with cloudflare app, and everything worked fine

It's helpful.👍

Hellodshboom01 avatar May 03 '24 04:05 Hellodshboom01

I got the same error i fixed it by adding the below line in wrangler.toml file

main = "./src/index.ts"

as my index.ts file was inside src folder.

Arunshaik2001 avatar May 04 '24 06:05 Arunshaik2001

Facing the same issue!

I have Next Js, file structure generated by this command

npm create cloudflare@latest my-next-app -- --framework=next

Here is file structure and Error

Screenshot 2024-05-09 at 6 47 28 PM

Facing similar issue.

I ran: npm create hono@latest

and used the x-basic template.

Then ran npx wrangler d1 create my-db

Now I am trying to execute wrangler dev

and I get:

~/my-app/app$ wrangler dev
 ⛅️ wrangler 3.57.2
-------------------

✘ [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler dev path/to/script`) or the `main` config field.

BChip avatar May 29 '24 02:05 BChip

@BChip - this is the correct method to replicate the issue.

debanjanbasu avatar Jul 16 '24 04:07 debanjanbasu