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

Run dev failed when there have a components folder #440

Open
chhpt opened this issue Feb 13, 2024 · 3 comments
Open

Run dev failed when there have a components folder #440

chhpt opened this issue Feb 13, 2024 · 3 comments
Labels
bug Something isn't working upstream Issue related to an upstream library

Comments

@chhpt
Copy link

chhpt commented Feb 13, 2024

Describe the bug

Run dev failed with the following error when there have a components folder


> [email protected] dev /Users/chaihe/Desktop/wxt
> wxt


WXT 0.14.6 
✖ Command failed after 244 ms                                                             

ERROR  EISDIR: illegal operation on a directory

ELIFECYCLE  Command failed with exit code 1.

To Reproduce

Open this stackblitz link https://stackblitz.com/~/github.com/chhpt/wxt-starter, or clone this repo https://github.com/chhpt/wxt-starter

Steps to reproduce the bug using the reproduction:

  1. Install dependencies: pnpm i

Expected behavior

Run dev successed

Screenshots

image

Environment

  System:
    OS: macOS 14.2.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 274.08 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 8.15.2 - ~/.nvm/versions/node/v20.11.0/bin/pnpm
    bun: 1.0.26 - ~/.bun/bin/bun
  Browsers:
    Chrome: 121.0.6167.160
    Edge: 113.0.1774.35
    Safari: 17.2.1
  npmPackages:
    wxt: ^0.14.0 => 0.14.6 

Additional context

@chhpt chhpt added the triage Bug or problem that needs to be looked into label Feb 13, 2024
@aklinker1
Copy link
Collaborator

aklinker1 commented Feb 14, 2024

This is an upstream issue with unimport, here's a related PR, just doesn't cover JSX/TSX files: unjs/unimport#229

I'll try and open a PR soon.


Looks like unimport is looking for index files when importing the directory (with an index file in it)...

https://github.com/unjs/unimport/blob/8a622c9c38d28ee9a80e7c0b8cb82bea05a69766/src/scan-dirs.ts#L94-L97

But it doesn't look for JSX/TSX extensions...

https://github.com/unjs/unimport/blob/8a622c9c38d28ee9a80e7c0b8cb82bea05a69766/src/scan-dirs.ts#L41-L48

So it tries to read the directory as a file, and we get this error

@aklinker1 aklinker1 added bug Something isn't working upstream Issue related to an upstream library and removed triage Bug or problem that needs to be looked into labels Feb 14, 2024
@aklinker1
Copy link
Collaborator

Quick fix:

-export * from './iframe'
+export * from './iframe/index.tsx'

@aklinker1
Copy link
Collaborator

I created an issue on unimport, will probably open a PR at some point once I figure out how to setup a valid test.

unjs/unimport#326

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

No branches or pull requests

2 participants