workers-sdk
workers-sdk copied to clipboard
🐛 BUG: missing entry-point
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
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
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
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 themainconfig 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.
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
Facing same issue. @cameron-robey kindly reopen the issue.
Facing same issue at https://developers.cloudflare.com/workers/tutorials/workers-kv-from-rust/#using-the-wrapper
facing same issue still...
Same issue in a CI monorepo.
I had the same issue, but I had "wrangler dev" running on another terminal, closing the other terminal fixed it for me.
Same issue for me in a simple github actions (monorepo with pnpm workspaces)
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.
---
Facing the same issue
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
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.
Had the same problem. Ended up creating worker in Cloudflare dashboard and then initialising locally.
-
npm install -g wrangler -
wrangler login -
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!
I've faced the same issue, but the reason was quite simple. ✅ I just had to
cdto the directory with cloudflare app, and everything worked fine
It's helpful.👍
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.
Facing the same issue!
I have Next Js, file structure generated by this command
npm create cloudflare@latest my-next-app -- --framework=nextHere is file structure and Error
![]()
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 - this is the correct method to replicate the issue.