Skip to content

[Bug] swizzle generates a BaseProps subpath import that is not exported #4091

Description

@is0060hf

Description

astryx swizzle Button generates this type import:

import type {BaseProps} from '@astryxdesign/core/BaseProps';

However, @astryxdesign/core does not define ./BaseProps in its package.json exports. Node package resolution reports ERR_PACKAGE_PATH_NOT_EXPORTED, and TypeScript reports TS2307.

The generated source should import BaseProps through a public package export. This could be addressed either by changing the swizzle import rewrite or by exporting the ./BaseProps subpath.

Reproduction

  1. Create a fresh Next.js 16 application.

  2. Install Astryx v0.1.6.

  3. Run:

    astryx swizzle Button
  4. Inspect the generated Button source. It imports BaseProps from @astryxdesign/core/BaseProps.

  5. Run TypeScript. It reports TS2307 because that subpath is not exported.

The same result was reproduced with v0.1.4.

Workaround

Change only the generated import to the package barrel:

import type {BaseProps} from '@astryxdesign/core';

After this one-line change, TypeScript exits with code 0. The import is type-only, so this workaround does not change runtime behavior.

Astryx Version

@astryxdesign/core@0.1.4 and @astryxdesign/core@0.1.6

Environment

Fresh Next.js 16 application

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