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

Support react-tweet #90

Closed
Tracked by #423
dai-shi opened this issue Jun 28, 2023 · 10 comments · Fixed by #541
Closed
Tracked by #423

Support react-tweet #90

dai-shi opened this issue Jun 28, 2023 · 10 comments · Fixed by #541
Assignees
Labels
help wanted Extra attention is needed

Comments

@dai-shi
Copy link
Owner

dai-shi commented Jun 28, 2023

If we wanted to use https://github.com/vercel-labs/react-tweet, CSS Modules should be supported on server.

Currently, it shows some errors with Vite ssrLoadModule. Fixed in #98 and WIP #105

We still have issues. Can anyone help?

@dai-shi dai-shi added the help wanted Extra attention is needed label Jun 28, 2023
@himself65
Copy link
Contributor

What is the error? I think the logic here is to collect *.module.css files and append them to response html?

@dai-shi
Copy link
Owner Author

dai-shi commented Jul 1, 2023

ssrLoadModule doesn't understand .module.css extension. It would be the easiest if we can simply ignore it.

@dai-shi
Copy link
Owner Author

dai-shi commented Jul 3, 2023

Here's the error message. My expectation is that Waku doesn't handle the logic directly, but instead let Vite do it.

[vite] Error when evaluating SSR module /src/components/App.tsx: failed to import "/src/components/App.module.css"
|- TypeError: Cannot read properties of undefined (reading 'set')
    at TransformContext.transform (file:///.../waku/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:37919:29)
    at async Object.transform (file:///.../waku/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:42919:30)
    at async loadAndTransform (file:///.../waku/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53385:29)

@dai-shi
Copy link
Owner Author

dai-shi commented Jul 3, 2023

with #98 the error is gone, but there are no styles.

@dai-shi dai-shi mentioned this issue Jul 4, 2023
94 tasks
@dai-shi
Copy link
Owner Author

dai-shi commented Jul 15, 2023

I will create a follow-up issue for #98 to support bare css modules.

@dai-shi
Copy link
Owner Author

dai-shi commented Jul 15, 2023

#105 is created and this issue is specific to support react-tweet.

@dai-shi dai-shi changed the title Support CSS Modules Support react-tweet Jul 15, 2023
@dai-shi
Copy link
Owner Author

dai-shi commented Nov 11, 2023

It seems to somewhat work for production build, but not for dev mode. We need someone who is familiar with Vite to help.

@Aslemammad
Copy link
Contributor

#171 This might fix this.

@dai-shi
Copy link
Owner Author

dai-shi commented Nov 26, 2023

Looking forward to it!

@Aslemammad
Copy link
Contributor

I'll work on this tomorrow! It's a matter of seeing if it works or not :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants