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

Incompatibility with certain libraries #30

Open
AntonOfTheWoods opened this issue Dec 9, 2024 · 0 comments
Open

Incompatibility with certain libraries #30

AntonOfTheWoods opened this issue Dec 9, 2024 · 0 comments

Comments

@AntonOfTheWoods
Copy link

AntonOfTheWoods commented Dec 9, 2024

import { expect, test } from "vitest";  // works
import utc from "https://esm.sh/dayjs/plugin/utc";  // works
import dayjs from "https://esm.sh/dayjs";  // works

import { and } from "https://esm.sh/drizzle-orm";  // works
// import { text } from "https://esm.sh/drizzle-orm/pg-core";  // doesn't work
// import { text } from "drizzle-orm/pg-core";  // works

test("with drizzle-orm", () => {
  dayjs.extend(utc);
  console.log(dayjs());

  console.log(and);

  // console.log(text);
  expect(1).toBe(1);
});

Originally I though the plugin might have issues with the 2nd and later levels in external modules, but the dayjs example suggests otherwise.

If you uncomment the // import { text } from "https://esm.sh/drizzle-orm/pg-core"; line AND the // console.log(text);, then I get the error:

FAIL  tests/bad.test.ts [ tests/bad.test.ts ]
Error: Only URLs with a scheme in: file and data are supported by the default ESM loader. Received protocol 'https:'

Any idea what's going on? Is there a workaround? Obviously I want this for a shared library between normal vite and deno.

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

1 participant