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

@astrojs/lit | this._$Ej.forEach is not a function #8825

Closed
1 task
andeeplus opened this issue Oct 13, 2023 · 5 comments · Fixed by #8826
Closed
1 task

@astrojs/lit | this._$Ej.forEach is not a function #8825

andeeplus opened this issue Oct 13, 2023 · 5 comments · Fixed by #8826
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) pkg: lit Related to Lit (scope)

Comments

@andeeplus
Copy link

Astro Info

Astro                    v3.3.0
Node                     v18.17.1
System                   macOS (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/lit

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Starting a new project from scratch I'm not able to render lit elements in any way except using the client:only="lit" directive.

Error: this._$Ej.forEach is not a function

TypeError: this._$Ej.forEach is not a function at MyElement.update (file:///Users/username/Desktop/test/node_modules/@lit/reactive-element/node/reactive-element.js:1:5579) at LitElementRenderer.connectedCallback (file:///Users/username/Desktop/test/node_modules/@lit-labs/ssr/lib/lit-element-renderer.js:51:42) at render (/Users/username/Desktop/test/node_modules/@astrojs/lit/server.js:62:11) at render.next (<anonymous>) at Object.renderToStaticMarkup (/Users/username/Desktop/test/node_modules/@astrojs/lit/server.js:108:11) at renderFrameworkComponent (/Users/username/Desktop/test/node_modules/astro/dist/runtime/server/render/component.js:205:66) at async Module.renderComponent (/Users/username/Desktop/test/node_modules/astro/dist/runtime/server/render/component.js:356:10)

What's the expected result?

Render the component without issue.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-fqvkdx?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 13, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Oct 13, 2023

Your reproduction installs Lit 3.0. It is not supported yet.

@lilnasy lilnasy closed this as completed Oct 13, 2023
@andeeplus
Copy link
Author

andeeplus commented Oct 13, 2023

@lilnasy I didn't install Lit, I've just used npx astro add lit.
Probably this is the problem.

Please re-open the issue.

@lilnasy lilnasy reopened this Oct 13, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Oct 13, 2023

Ok, it seems to install 3.0 by default. As a wrokaround, you can ensure the version in your package json is exactly "2.8.0".

@lilnasy lilnasy added pkg: lit Related to Lit (scope) - P2: has workaround Bug, but has workaround (priority) labels Oct 13, 2023
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Oct 13, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Oct 13, 2023

@lit-labs/ssr-client has started requiring lit 3.0. Annoyingly, this breaking change was made in a patch release. Our adapter will have to pin it to 1.1.3 to unbreak builds.

@lilnasy lilnasy added - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) and removed - P2: has workaround Bug, but has workaround (priority) labels Oct 13, 2023
@andeeplus
Copy link
Author

andeeplus commented Oct 13, 2023

@lilnasy Glad you find a quick fix, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) pkg: lit Related to Lit (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants