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

[Bug]: Using astro:db I'm unable to load package with scheme astro: #30784

Closed
nicolascochin opened this issue May 14, 2024 · 2 comments
Closed

Comments

@nicolascochin
Copy link

Version

1.44.0

Steps to reproduce

within a setup db project

[...]
projects: [
  {
    name: "setup db",
    testMatch: /global\.setup\.ts/,
  },
  {
    name: "chromium",
    use: { ...devices["Desktop Chrome"] },
    dependencies: ["setup db"],
  },
]
[...]

I have this global.setup.ts file:

import { test as setup } from "@playwright/test";
import { db, User } from "astro:db";

setup("Init users", async ({}) => {
  const users = await db.select().from(User);
});

Expected behavior

The users to be loaded

Actual behavior

the following error occurs:
Error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'astro:'

Additional context

No response

Environment

System:
    OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1270P
    Memory: 27.28 GB / 46.75 GB
    Container: Yes
  Binaries:
    Node: 21.6.2 - ~/.anyenv/envs/nodenv/versions/21.6.2/bin/node
    npm: 10.2.4 - ~/.anyenv/envs/nodenv/versions/21.6.2/bin/npm
  IDEs:
    VSCode: 1.89.1 - /usr/local/bin/code
  Languages:
    Bash: 5.1.16 - /usr/bin/bash
  npmPackages:
    @playwright/test: ^1.44.0 => 1.44.0
@mxschmitt
Copy link
Member

I tried require("astro:db") inside Node.js and it doesn't work either - so maybe since it doesn't work with a normal Node.js script it doesn't work with Playwright?

@nicolascochin
Copy link
Author

Yeah maybe.. Thank you for your investigation. I'm closing this issue since it doesn't sounds like a playwright's issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants