huntabyte / cmdk-sv

cmdk, but for Svelte ✨
https://cmdk-sv.com
MIT License
410 stars 17 forks source link

Exports issue, common js, path resolution #63

Closed ynnoj1 closed 4 months ago

ynnoj1 commented 4 months ago

I am having trouble when using the command component in shadcn-svelte and believe it may be caused by cmdk-sv.

ReferenceError: exports is not defined at /node_modules/cmdk-sv/dist/index.js:25:23

I've tried a number of fixes aimed at handling commonjs:

When commonjs fixes are applied i run into issues with resolving files in the $lib path:

✘ [ERROR] Could not resolve "$lib/internal/command-score.js" ✘ [ERROR] Could not resolve "$lib/internal/index.js"

A recent change updated the package to sveltekit 2.0, I cannot determine if it is related to this.

To replicate this issue:

kloon15 commented 4 months ago

Happened to me aswell on svelte 4 when upgrading from 0.0.13, rolling back fixes the issue.