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

isr: NG0500: During hydration Angular expected <div> but found <button> #1726

Open
timsar2 opened this issue May 24, 2024 · 0 comments
Open
Assignees
Labels
🐞 Bug Bug: Something isn't working 🚀 ISR

Comments

@timsar2
Copy link

timsar2 commented May 24, 2024

Description

By creating a new angular project I just add a button in appcomponent.html under the main tag and I got this error During the watch mode:

npm run watch

node .\dist\isr\server\server.mjs --watch

Error: NG0500: During hydration Angular expected <div> but found <button>.

Angular expected this DOM:

<main _ngcontent-ng-c4078563999="" class="main">
  …
  <router-outlet>…</router-outlet>
  <div>…</div>  <-- AT THIS LOCATION
  …
</main>

server.ts:

const isr = new ISRHandler({
    indexHtml,
    invalidateSecretToken: process.env['INVALIDATE_TOKEN'] || 'MY_TOKEN', // replace with env secret key ex. process.env.REVALIDATE_SECRET_TOKEN
    enableLogging: !environment.production,
    serverDistFolder,
    browserDistFolder,
    bootstrap,
    commonEngine
  });

"@rx-angular/isr": "^17.1.0"

@hoebbelsB hoebbelsB changed the title Title of the bug isr: NG0500: During hydration Angular expected <div> but found <button> May 24, 2024
@hoebbelsB hoebbelsB added 🚀 ISR 🐞 Bug Bug: Something isn't working labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Bug: Something isn't working 🚀 ISR
Projects
None yet
Development

No branches or pull requests

3 participants