Repository navigation
Description
Reproduction link or steps
tsconfig.json:
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"declaration": true,
"declarationMap": true,
"module": "preserve",
"noEmit": true,
"lib": ["es2022", "dom", "dom.iterable"],
"jsx": "react-jsx",
"jsxImportSource": "react",
"types": ["@testing-library/jest-dom/vitest"],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src", "test"]
}Source Code:
import { ItemContext } from '../modules/item-context';
import { RootContext } from '../modules/root-context';
import Check from '@/internal/components/check';
import type { HTMLAttributes } from '@/internal/html-attributes';
import type { PropsWithElement } from '@/internal/props-with-element';
import { classesCombobox } from '@skeletonlabs/skeleton-common';
import { mergeProps } from '@zag-js/react';
import { use } from 'react';
export interface ComboboxItemIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
export default function ItemIndicator(props: ComboboxItemIndicatorProps) {
const combobox = use(RootContext);
const itemProps = use(ItemContext);
const { element, children = <Check className="size-4" />, ...rest } = props;
const attributes = mergeProps(
combobox.getItemIndicatorProps(itemProps),
{
className: classesCombobox.itemIndicator,
},
rest,
);
return element ? element(attributes) : <div {...attributes}>{children}</div>;
}Console output:
[UNRESOLVED_IMPORT] Warning: Could not resolve '@/internal/components/check' in src/components/combobox/anatomy/item-indicator.tsx
╭─[ src/components/combobox/anatomy/item-indicator.tsx:3:19 ]
│
3 │ import Check from '@/internal/components/check';
│ ──────────────┬──────────────
│ ╰──────────────── Module not found, treating it as an external dependency
───╯
What is expected?
The build should be fine and aliases like @ should be transpiled to their actual path (it should be ../../../internal
What is actually happening?
The @ is kept (likely because it thinks it's a module and not a path?)
Any additional comments?
When I check the .d.ts files from the same source file, it shows the correct processed aliases:
import { HTMLAttributes } from "../../../internal/html-attributes.js";
import { PropsWithElement } from "../../../internal/props-with-element.js";
import * as react19 from "react";
//#region src/components/combobox/anatomy/item-indicator.d.ts
interface ComboboxItemIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
declare function ItemIndicator(props: ComboboxItemIndicatorProps): react19.JSX.Element;
//#endregion
export { ComboboxItemIndicatorProps, ItemIndicator as ItemIndicator$3 };
//# sourceMappingURL=item-indicator.d.ts.mapNotice how the HTMLAttributes import actually has the correct path, for some reason the .d.ts output is correct but the .js output is incorrect. 🤔
Edit:
Funnily enough changing import Check from '@/internal/components/check'; to import Check from '@/internal/components/check.jsx'; fixes it
Edit 2:
I managed to fix this by simply overriding the tsdown>rolldown version to the latest rolldown version. For some reason the latest that tsdown specifices resolves to 1.0.0-beta.9 instead of 1.0.0-beta.41 (latest). Seems like this is a bug with how either pnpm resolves versions or perhaps rolldown publishing wrong versions.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Activity
[-]path aliases are not processed?[/-][+]path aliases are not processed[/+]sxzz commentedon Oct 1, 2025
Let's track to #500