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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astro v5.0.4 - [astro:db] [vite] cannot find entry point module 'astro:db' #12699

Closed
1 task
cameronapak opened this issue Dec 9, 2024 · 19 comments
Closed
1 task
Assignees
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: db

Comments

@cameronapak
Copy link

Astro Info

Astro                    v5.0.4
Node                     v22.5.1
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/netlify
Integrations             astro:db
                         @astrojs/db/file-url
                         @astrojs/tailwind
                         @astrojs/alpinejs

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When running npm run dev, I encounter an error message in the console that says:

[ERROR] [astro:db] [vite] cannot find entry point module 'astro:db'.

This has been referenced in #12474, but I find that it was not fully fixed.

What's the expected result?

I expect it to not product and print that Vite error for Astro DB.

Link to Minimal Reproducible Example

cameronapak/freedom-stack#45

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 9, 2024
@JeremyPittard
Copy link

If it's any help for evidence I am also seeing this on windows 11 running node 22.12 and WSL. I am also finding the db does not seed with seed.ts.

@jackmcpickle
Copy link

getting same issue on new install

Astro                    v5.0.4
Node                     v20.12.2
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/tailwind
                         astro:db
                         @astrojs/db/file-url

@jackmcpickle
Copy link

NOTE - working when I use pnpm dev --remote

@PaiiNKiilleRD
Copy link

Same here

"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/cloudflare": "^12.0.1",
"@astrojs/db": "^0.14.3",
"@astrojs/rss": "^4.0.10",
"@astrojs/sitemap": "^3.2.1",
"astro": "^5.0.4",
"typescript": "^5.7.2"
}

@ngdangtu-vn
Copy link

Me too,

$ bun -v
1.1.37
"dependencies": {
  "@astrojs/cloudflare": "^12.0.1",
  "@astrojs/db": "^0.14.3",
  "@astrojs/sitemap": "^3.2.1",
  "@astrojs/solid-js": "^5.0.0",
  "@astrojs/tailwind": "^5.1.3",
  "astro": "^5.0.4",
  "astro-icon": "^1.1.4",
  "solid-devtools": "^0.30.1",
  "solid-js": "^1.9.3",
  "tailwindcss": "^3.4.16"
}

It seems like everyone in here have a problem with this integration in Astro 5 right?

@francescostella
Copy link

Same here using:
"@astrojs/db": "^0.14.3" and "astro": "^5.0.4"

It seems Vite 6 has issues in parsing the import from astro:db specifically

@ascorbic ascorbic self-assigned this Dec 11, 2024
@ascorbic ascorbic added - P2: nice to have Not breaking anything but nice to have (priority) pkg: db and removed needs triage Issue needs to be triaged labels Dec 11, 2024
@ascorbic
Copy link
Contributor

It looks like the problem is that the fixed version of @astrojs/db wasn't successfully published. I'm looking into what's gone wrong.

@mckoda09
Copy link

mckoda09 commented Dec 12, 2024

Astro                    v5.0.5
Node                     v23.3.0
System                   Linux (x64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             astro:db
                         @astrojs/db/file-url

the same issue

@ascorbic
Copy link
Contributor

I'll try and get a patch release out today with the fixes: #12716

@mckoda09
Copy link

@ascorbic so the patch will be soon?

@ascorbic
Copy link
Contributor

I'll try to get it out today.

@jeffscottward
Copy link

Is this possibly related to my issue with a very basic form request?

TypeError: Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".

Using this example basically verbatim:
https://docs.astro.build/en/guides/astro-db/#insert

@mckoda09
Copy link

@jeffscottward i guess no, because db works, just a little error in console.

@jeffscottward
Copy link

jeffscottward commented Dec 15, 2024

@jeffscottward i guess no, because db works, just a little error in console.

I verified it's

  • pulling from remote Turso. (test data record in remote db)
  • .env config
  • Seed / Config / FormData / Insert / Schema all align
  • Busted cache
  • Checked dev --remote flag.

Im totally stumped even with AI help.
This code is the only thing that could possibly be causing it.
I've commented it out and this is culprit

---
import { db, cashOfferRequests } from "astro:db";

if (Astro.request.method === "POST") {
  try {
    const formData = await Astro.request.formData();

    const firstName = formData.get("firstName")?.toString() ?? "";
    const lastName = formData.get("lastName")?.toString() ?? "";
    const email = formData.get("email")?.toString() ?? "";

    if (
      firstName &&
      lastName &&
      email
    ) {
      await db.insert(cashOfferRequests).values({
        firstName,
        lastName,
        email,
      });
    }
  } catch (error) {
    console.error("Error processing form submission:", error);
  }
} 

---

<form
  id="sellForm"
  method="POST"
  enctype="multipart/form-data"
  class="bg-[#F5F5DC] p-8 rounded-lg shadow-lg space-y-12"
>

Theres something here and it's not me almost for sure.

src/components/SellForm.astro
Error processing form submission: TypeError: Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".
    at node:internal/deps/undici/undici:5426:19
    at successSteps (node:internal/deps/undici/undici:5454:27)
    at consumeBody (node:internal/deps/undici/undici:5460:9)
    at _Request.formData (node:internal/deps/undici/undici:5403:18)
    at eval (   REDACTED   marketing/src/components/SellForm.astro:19:45)

@jeffscottward
Copy link

Confirmed bug in isolated repo:
See #12741

@ascorbic
Copy link
Contributor

Thanks everybody. There's no need for any more details. The fix for this is already merged. To be clear: you can safely ignore the warning. Your sites will still work. The error will disappear once we put out a release.

@cameronapak
Copy link
Author

Wonderful. Thanks so much @ascorbic !

tinoue-team pushed a commit to kinmapping/linuledge that referenced this issue Dec 16, 2024
- astro version 4 -> 5
- いくつかのビルドエラーが発生
	- withastro/starlight#2658
	- output の設定が変更される=> 削除:hybridレンダリングモード(https://docs.astro.build/en/guides/upgrade-to/v5/#removed-hybrid-rendering-mode)
	- [cannot find entry point module 'astro:db' について](withastro/astro#12699)
@LLLisa
Copy link

LLLisa commented Dec 17, 2024

So glad the Astro team is on the ball like this. I ran into this bug Saturday, found this issue and decided to wait to see if it would be fixed on Monday, and it was. Big kudos

@JeremyPittard
Copy link

Thankyou muchly, has also resolved my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: db
Projects
None yet
Development

No branches or pull requests

10 participants