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

using @starbeam/react Component breaks vite css module auto reload #118

Open
patricklx opened this issue Sep 18, 2023 · 7 comments
Open

Comments

@patricklx
Copy link
Contributor

patricklx commented Sep 18, 2023

in a react vite project
if I have a

import styles from './App.module.css';

...
return Component(() => (<div className={styles.app}> </div>));

auto reload of css will not work anymore...

however, if I use useReactive it works

@NullVoxPopuli
Copy link
Contributor

hello! does the latest unstable publish have the same issue?

@patricklx
Copy link
Contributor Author

patricklx commented Oct 11, 2023

cannot install

 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "@domtree/flavors@workspace:^" is in the dependencies but no package named "@domtree/flavors" is present in the workspace

This error happened while installing the dependencies of @starbeam/[email protected]
 at @starbeam/[email protected]

edit: manually installed @domtree/flavors and then install worked

@patricklx
Copy link
Contributor Author

patricklx commented Oct 11, 2023

now failing because of import.meta.url vitejs/vite#14169
this is inside the vitests of @starbeam/debug...
is there not way to strip out the test parts when published?

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Oct 11, 2023

There will be. We currently don't have a production build were happy with, but that'll happen very soon.

What's published right now is development stuff.

@NullVoxPopuli
Copy link
Contributor

what's your build environment like?

if you using esm.sh, like here: https://jsbin.com/kivuqal/1/edit?html,output it can compile away the import.meta stuff.

otherwise, you may need something like https://iendeavor.github.io/import-meta-env/guide/getting-started/introduction.html

@patricklx
Copy link
Contributor Author

well, one step forward.
Now i get that useSetup is not exported. And I see it does not exist anymore.
Maybe I do not even need it?

@NullVoxPopuli
Copy link
Contributor

yeah, there's been a streamlining of concepts since the docs were written -- here is a current example: https://github.com/starbeamjs/starbeam/blob/main/demos/react/src/components/formatter/DateFormatter-v1.tsx#L15

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

2 participants