Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build Vue + Headless UI #246

Closed
dvlden opened this issue Nov 27, 2023 · 2 comments · Fixed by #247
Closed

Unable to build Vue + Headless UI #246

dvlden opened this issue Nov 27, 2023 · 2 comments · Fixed by #247
Labels
bug Something isn't working

Comments

@dvlden
Copy link
Contributor

dvlden commented Nov 27, 2023

Describe the bug

It throws and fails to build the output.

To Reproduce

Reproduction.zip

  1. Install WXT with Vue
  2. Install Headless UI pnpm install @headlessui/vue
  3. Use one of the Headless UI components in the project (in the Popup for example)
  4. Extend wxt.config.ts with:
imports: {
    presets: ['vue'],
    addons: {
      vueTemplate: true,
    },
  },
  1. Run WXT's build script pnpm run build

Expected behavior

Successfully compiles the project without conflicts. Maybe there's a way to also auto-import Headless UI, but I haven't found it suggested by TS in the imports.presets array.

What resolves it for me is to configure imports: false and then manually do all of the importing where necessary.

Screenshots

Screenshot 2023-11-27 at 18 24 12

Environment

  System:
    OS: macOS 14.1.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 59.28 GB / 96.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.3.1 - ~/.nvm/versions/node/v20.3.1/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v20.3.1/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.3.1/bin/npm
    pnpm: 8.6.12 - ~/.nvm/versions/node/v20.3.1/bin/pnpm
    bun: 1.0.10 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 119.0.6045.159
    Safari: 17.1
  npmPackages:
    wxt: ^0.10.2 => 0.10.2 
@dvlden dvlden added the pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug label Nov 27, 2023
@aklinker1 aklinker1 added bug Something isn't working and removed pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug labels Nov 28, 2023
@aklinker1
Copy link
Collaborator

Appears to be an issue with unimport, there's a similar problem for nuxt: nuxt/nuxt#18823 (comment)

WXT doesn't provide the imports.transform.exclude option, but this is fixed by not adding imports to dependencies inside node_modules.

@aklinker1
Copy link
Collaborator

Released in v0.10.3. Let me know if it doesn't work for you @dvlden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants