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

Non-critical error when running Astro 5 in dev mode: "[vite] cannot find entry point module 'astro:db'." #12474

Closed
1 task
goosechaser opened this issue Nov 19, 2024 · 15 comments · Fixed by #12628
Labels
5.0 beta Related to the Astro 5.0 beta - P3: minor bug An edge case that only affects very specific usage (priority) pkg: db

Comments

@goosechaser
Copy link

Astro Info

Astro                    v5.0.0-beta.8
Node                     v20.10.0
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/svelte
                         @astrojs/tailwind
                         astro:db
                         @astrojs/db/file-url

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

No response

Describe the Bug

Running npm run dev shows:

18:33:24 [types] Generated 1ms

 astro  v5.0.0-beta.8 ready in 1114 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

▶ This is a  beta  prerelease build!
  Report issues here: https://astro.build/issues

18:33:24 watching for file changes...
18:33:24 [astro:db] New local database created.
18:33:24 [ERROR] [astro:db] [vite] cannot find entry point module 'astro:db'.
18:33:56 [astro:db] Seeded database.
....

Everything works though.

What's the expected result?

No error should be displayed.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-f2kqtd?file=src%2Fpages%2Findex.astro

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 Nov 19, 2024
@apatel369
Copy link
Contributor

I can reproduce this error:

17:06:28 watching for file changes...
17:06:28 [astro:db] New local database created.
17:06:28 [ERROR] [astro:db] [vite] cannot find entry point module 'astro:db'.
17:06:32 [astro:db] Seeded database.
17:06:33 [200] / 1407ms

@ematipico ematipico added 5.0 beta Related to the Astro 5.0 beta - P3: minor bug An edge case that only affects very specific usage (priority) pkg: db and removed needs triage Issue needs to be triaged labels Nov 20, 2024
@Dame-G
Copy link

Dame-G commented Nov 25, 2024

Also getting same output. v. 5.0.0 beta 7

19:08:20 [types] Generated 2ms
19:08:20 [vite] Re-optimizing dependencies because lockfile has changed
19:08:21 [astro:db] New local database created.
19:08:21 [ERROR] [astro:db] [vite] cannot find entry point module 'astro:db'.

@jonaspm
Copy link

jonaspm commented Dec 3, 2024

I am facing the same error in Astro v5.0.1:

13:35:56 [astro:db] New local database created.
13:35:56 [ERROR] [astro:db] [vite] cannot find entry point module 'astro:db'.

@brunogarba
Copy link

I'm getting the same issue after upgrading to 5.0.1

@ochoa8al
Copy link

ochoa8al commented Dec 3, 2024

same error

@0bkevin
Copy link

0bkevin commented Dec 3, 2024

Same error here, just upgrade to astro v5

@0bkevin
Copy link

0bkevin commented Dec 3, 2024

For my, the error only happens when you have installed @astro/mdx when I uninstall it, it works normally.

{
  "name": "...",
  "type": "module",
  "version": "0.0.1",
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro check && astro build",
    "preview": "astro preview",
    "astro": "astro"
  },
  "dependencies": {
    "@astrojs/check": "^0.9.4",
    "@astrojs/svelte": "^7.0.1",
    "@astrojs/tailwind": "^5.1.3",
    "astro": "^5.0.1",
    "svelte": "^5.2.2",
    "swiper": "^11.1.15",
    "tailwindcss": "^3.4.15",
    "typescript": "^5.6.3"
  },
  "devDependencies": {
    "@tailwindcss/typography": "^0.5.15",
    "@types/node": "^17.0.15"
  }
}

@ascorbic
Copy link
Contributor

ascorbic commented Dec 4, 2024

This seems to be coming from here, where we try to eagerly-load the virtual module. What the error message isn't showing is that the module it's trying to load is actually \0astro:db. The null-prefixed name is used internally by the Vite plugin. What is unclear is whether that is deliberate. I'll defer to @bholmesdev on that. What I do know is that changing it to instead import "astro:db" fixes the immediate issue.

@morinokami
Copy link
Contributor

I was able to reproduce it with just Astro v5 + @astrojs/db:

https://stackblitz.com/edit/withastro-astro-m8d7mh?file=package.json

@Uninen
Copy link

Uninen commented Dec 5, 2024

FWIW I get this error as a critical error (which prevents dev server to start) when I install @astrojs/mdx with 5.0.2:

03:41:59 [ERROR] [vite] cannot find entry point module '/[...]/node_modules/.pnpm/@astrojs+mdx@4.0.1_astro@5.0.2_@types+node@22.10.1_jiti@1.21.6_rollup@4.28.0_typescript@5.6.3_yaml@2.6.1_/node_modules/@astrojs/mdx/dist/server.js'.

@ascorbic
Copy link
Contributor

ascorbic commented Dec 5, 2024

@Uninen that won't be related to this

@cameronapak
Copy link

cameronapak commented Dec 8, 2024

I am getting the same error:

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

My package.json includes:

"@astrojs/db": "^0.14.3",
"astro": "^5.0.3",

Here's the codebase.

P.S. I absolutely love Astro and am thankful for all who contribute to it!

@bholmesdev
Copy link
Contributor

Hey @cameronapak! Thanks for reporting. Looks like we're on 5.0.4 right now. Can you confirm this still occurs on the latest? If so, it may be worth making a new issue with a link to your codebase

@cameronapak
Copy link

Will do, @bholmesdev!

@jonaspm
Copy link

jonaspm commented Dec 9, 2024

I confirm it still happens in v5.0.4:
imagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 beta Related to the Astro 5.0 beta - P3: minor bug An edge case that only affects very specific usage (priority) pkg: db
Projects
None yet
Development

Successfully merging a pull request may close this issue.