Skip to content

Using imports from external packages #5

Open
@aurelien-boubennec

Description

@aurelien-boubennec

Hi,

When I test this code in a React web app:

import { threaded } from "multithreading";

const getId = threaded(async function* () {
  const { v4 } = yield "uuid"; // Import other package

  return v4();
}

console.log(await getId()); // 1a107623-3052-4f61-aca9-9d9388fb2d81

I get the following error:

TypeError: Failed to execute 'resolve' on 'import.meta': Failed to resolve module specifier uuid: Relative references must start with either "/", "./", or "../".

The uuid package is installed and I use Vite as the dev server.

I tried yield "./uuid" but it returns undefined.

Any idea what path is expected? Thank you 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions