Skip to content

Package resolution fails in Vite due to missing index.ts in development export #125

@shreyassanthu77

Description

@shreyassanthu77

Both openworkflow and @openworkflow/backend-postgres have package.json files with a development export condition pointing to ./index.ts:

"exports": {
  ".": {
    "development": "./index.ts",
    "default": "./dist/index.js"
  }
}

but only the dist folder is published to npm (per "files": ["dist"]), so the index.ts file doesn't exist in the installed package. When Vite tries to resolve the package in development mode, it just fails with:
Error: Failed to resolve entry for package "openworkflow" ...

Solution:

Either remove the "development" export condition from both packages, or include the source files in the published packages.

Workaround:

I currently have a janky postinstall script that removes the development export to make it work :) Wanted to open an issue before submitting a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions