Replies: 10 comments 2 replies
-
So there are a couple of issues here but to try and break them down
So the issue here is that Lit's SSR capability does not support native I could have sworn I had this called out in the caveat's section but it is not there, so I have opened a PR to document this, so thanks for catching this! 👀 edit: I agree not seeing the error during development is annoying, and so we plan to bring the
Based on the demo repo I have been validating these changes in, I was able to confirm all the Spectrum JS and CSS imports work in both dev and prod builds and you can see a production build here hosted on Vercel. Do note I use the bare specifier when calling it from JavaScript import SpectrumCard from '@spectrum-css/card' with { type: 'css' };
console.log({ SpectrumCard }); The path you're using looks to be more of their recommendation when using Let me add an example of the CSS flavor that to that demo though just to make sure I don't forget any use cases. (Also keeping in mind this is all in alpha stage, I would ask that we use Discord for this kind of pre-release feedback, or the existing issue if one exists to help keep the conversations in one place) |
Beta Was this translation helpful? Give feedback.
-
So added a demonstration of using |
Beta Was this translation helpful? Give feedback.
-
Oh. I forgot to put I had also tested in 0.30.2, what I was actually trying to type was that it was still there. |
Beta Was this translation helpful? Give feedback.
-
Sorry, could you clarify to which of the above points you are referring to here? |
Beta Was this translation helpful? Give feedback.
-
when I filed the bug, I first observed the behaviors listed with
and then upgraded to the alpha to see if the changes fixed them. I reported only after seeing that they persisted. From our further discussions, I realize that the first bullet point about the html element is almost certainly me misunderstanding the prerendering and the lit renderer plugin, so I'm exploring that more. |
Beta Was this translation helpful? Give feedback.
-
Updated the description to reflect the part that remains an outstanding bug now that you've explained things to me. The tip of the branch now has a better minimal reproduction. |
Beta Was this translation helpful? Give feedback.
-
Hmm, I'm not seeing the commented out lines that you reference in your description? That said, this error
This Is unfortunately expected when using Lit+SSR for prerendering or SSR routes. The is item no. 3 in the caveats section I think they are open to PRs adding it to their DOM Shim though.
Because of the above issue, I don't see any other error and maybe also because I don't see that example in the branch you shared? 🤔 I think this is better tracked as discussion for now as we work through the multiple items being covered here Q & A style (we can have one comment thread per item that way if the migration doesn't get too funky), and then happy to extract any reproductions we find into their own issue once we've landed on them concretely. |
Beta Was this translation helpful? Give feedback.
-
okay, so after playing with the css loaders in the thread that links to for a while, and hitting all sorts of errors that are far from intuitive, I decided to try using lit elements without using the lit renderer. https://github.com/lschierer/greenwood-repoductions/blob/no-lit/src/components/test-element.ts is the result. on the main index page, if you run |
Beta Was this translation helpful? Give feedback.
-
On the topic of So here is the new issue I made to follow along to and I will see if I can get a PR to them next weekend to help remove this entire caveat from using Lit+SSR (in Greenwood). Should be a quick one and not much to review, so don't expect it will take too long to see it merged and published from their end. 🤞 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update , fingers crossed indeed. |
Beta Was this translation helpful? Give feedback.
-
Type of Change
Bug
Summary
build and dev mode show different behaviors with typescript. Something that works in dev should at least build.
Details
pnpm run dev
but will show a runtime error saying it cannot find the module. The component will not render. If you run
pnpm run build
you will be told
pnpm run dev
and the component will render. However, if you runpnpm run build
you getThis has been reproduced with 0.30.2 and with 0.31.0-alpha.0
This description has been updated to remove portions that were not in fact bugs but reflected failures of my understanding.
Beta Was this translation helpful? Give feedback.
All reactions