-
Notifications
You must be signed in to change notification settings - Fork 12
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
HTMLDivElement is not defined #134
Comments
If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.@FrancisBaah Thank you for opening this issue. 🙏
This is an automated message, feel free to ignore. |
@FrancisBaah Could you provide more info/steps on how you are deploying the app, e.g. are you using one of the approaches described here? This will help us reproduce the issue. Thanks! |
Error occurs in Next.js (Pages router) during server-side rendering:
When importing any React-component, e.g.: import { PlacePicker } from "@googlemaps/extended-component-library/react"; Originates from 180: __decorate([
181: query('.main-container'),
182: __metadata("design:type", HTMLDivElement)
183: ], OverlayLayout.prototype, "mainContainer", void 0); Other similar |
I'm having the same problem using Next.js |
Hi @codeclown @ImperadorSid, unfortunately Web Components in general don't work well with server-side rendering, though there're workarounds in the case of Next.js. Could you check if the dynamic loading technique used in this sample project helps? See docs for more info. Another option you may explore is @lit-labs/nextjs, but note that Lit SSR is under active development and has some limitations. |
You need to do this
|
Dynamic loading doesn't seem to fully resolve the issue, because the error mentions |
Dynamic loading solves the issue for me in NextJs. A snippet:
|
import { APILoader } from '@googlemaps/extended-component-library/react';
The code works fine on localhost, but give "HTMLDivElement is not defined" error on deploy.
The text was updated successfully, but these errors were encountered: