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

Tree Not Generated #29

Open
jeffreystorer opened this issue Feb 27, 2023 · 5 comments
Open

Tree Not Generated #29

jeffreystorer opened this issue Feb 27, 2023 · 5 comments

Comments

@jeffreystorer
Copy link

After selecting the root file, I see only that file, with no tree. The file bubble has only a link to open the file.

I get the same behavior with react apps created with CRA and Vite.

@MichaelBenliyan
Copy link
Contributor

Hello Jeffrey!
Thanks for reaching out. Not sure why you're experiencing those issues. It's hard to debug without more specific information regarding the files that are giving you this issue. There might be something we've overlooked in our parsing system that is making it not find the child components in the JSX/TSX files you're talking about. Would be happy to provide more help if you can provide more info.
Best

@jeffreystorer
Copy link
Author

jeffreystorer commented Feb 28, 2023 via email

@MichaelBenliyan
Copy link
Contributor

Good morning Jeffrey!
Thank you for providing the repo you are experiencing this issue in. After forking and testing it out, I see the problem you are facing. The issue is actually coming from ReacTree currently not supporting absolute imports (the imports starting with '@'). If those imports are modified to be with the older style of './components/...' then it will work. Thank you for bringing this to our attention. I will update this thread when ReacTree supports absolute imports.
Hope this helped clear things up.
Best

@jeffreystorer
Copy link
Author

jeffreystorer commented Feb 28, 2023 via email

@ptim
Copy link

ptim commented Sep 13, 2023

I have this issue also, in a vite react-ts project using root-relative imports.

I will update this thread when ReacTree supports absolute imports.

I didn't spot anything in the README about this issue - it would be great to mention there... I also wondered if react-router is supported, but didn't find a mention of that either.

My abbr config:

// tsconfig.json
{
  "compilerOptions": {
    "baseUrl": "./src"
    // ...
  }
}
// vite.config.ts
export default defineConfig(({ mode }) => {
  const baseConfig = {
    base: '',
    plugins: [
      react(),
      // allows vite and vitest to resolve TS path config (eg 'baseUrl')
      tsconfigPaths(),
    ],
    // ...
  }
  return baseConfig
})
// main.ts
import { Button } from 'components';

// ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants