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

Issue with monorepo? #1032

Open
Emsu opened this issue Dec 4, 2024 · 11 comments · May be fixed by #1079
Open

Issue with monorepo? #1032

Emsu opened this issue Dec 4, 2024 · 11 comments · May be fixed by #1079

Comments

@Emsu
Copy link

Emsu commented Dec 4, 2024

I added waku into a pnpm monorepo and a standalone repo via pnpm create waku@latest. The standalone repo is building currently and showing the app but the one installed into a monorepo errors with Error: Missing Root component.

Any ideas on how the create-waku app in a monorepo is different from standalone?

@tylersayshi
Copy link
Contributor

tylersayshi commented Dec 4, 2024

This error usually means you're missing a Router in one way or another. Could you share the output of git ls-tree -r --name-only HEAD | tree --fromfile from the broken project so we could see what files you have there?

A thing to look for is if you have a src/main.tsx and what the contents of that are. This would conflict with our default Router being included.

It seems unlikely that this is specific to use in a monorepo though example apps in the examples dir of the waku monorepo here.

@dai-shi
Copy link
Owner

dai-shi commented Dec 4, 2024

This is duplicate of #676 (and #684).

It's a known limitation and our target is to tackle it after v0.22.

However if anyone is interested (looking at @tylersayshi ), feel free to tackle beforehand. Nothing is blocking to work on it.

@Emsu
Copy link
Author

Emsu commented Dec 5, 2024

@tylersayshi do you mean from the monorepo project or the waku project within the monorepo?
from within the waku project it's:

git ls-tree -r --name-only HEAD | tree --fromfile
.
├── .gitignore
├── package.json
├── postcss.config.js
├── public
│   └── images
│       └── favicon.png
├── src
│   ├── components
│   │   ├── counter.tsx
│   │   ├── footer.tsx
│   │   └── header.tsx
│   ├── pages
│   │   ├── _layout.tsx
│   │   ├── about.tsx
│   │   └── index.tsx
│   ├── pages.gen.ts
│   └── styles.css
├── tailwind.config.js
└── tsconfig.json

6 directories, 14 files

@tylersayshi
Copy link
Contributor

@Emsu I misspoke in my initial message. the issue @dai-shi shared above is something I need to look into now. I'll update when I make progress on this, sorry

@Emsu
Copy link
Author

Emsu commented Dec 5, 2024

@tylersayshi gotcha I'll close this out in favor of the referenced issues then.

@Emsu Emsu closed this as completed Dec 5, 2024
@tylersayshi
Copy link
Contributor

... actually @Emsu I am looking more closely now and I think your issue is unique. Can you re-open? sorry for my confusion.

Is this project open source or are you able to give any details for how to reproduce?

@tylersayshi
Copy link
Contributor

@Emsu are you able to retry with [email protected]?

@rmarscher saw the same error in their monorepo and were able to resolve after upgrading.

if no luck with that, I’m happy to take a deeper look if we can reproduce it somehow. Thanks!

@rmarscher
Copy link
Contributor

I found that #1056 was caused by running in a monorepo. It makes the import paths include the absolute system file path instead of the relative project path because the import is outside the root of the project.

@dai-shi
Copy link
Owner

dai-shi commented Dec 13, 2024

Thanks @rmarscher for looking into it.

If #1056 was the same issue as this one, which makes sense because it can cause Error: Missing Root component, it should be already solved in the main branch.

Would anyone like to give a try and see if it's really solved?
Maybe it's easier to use a codesandbox build from #1065.
https://ci.codesandbox.io/status/dai-shi/waku/pr/1065/builds/570340

npm i https://pkg.csb.dev/dai-shi/waku/commit/09431e6c/waku

@dai-shi
Copy link
Owner

dai-shi commented Dec 15, 2024

Please try v0.21.9. If any problem exists with a monorepo setup, please open a new issue.

@dai-shi dai-shi closed this as completed Dec 15, 2024
@dai-shi
Copy link
Owner

dai-shi commented Dec 22, 2024

Let's keep this open while #1079 is in progress.

@dai-shi dai-shi reopened this Dec 22, 2024
@dai-shi dai-shi linked a pull request Dec 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

4 participants