rx-angular icon indicating copy to clipboard operation
rx-angular copied to clipboard

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

Open timsar2 opened this issue 1 year ago • 1 comments
trafficstars

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"

timsar2 avatar May 24 '24 08:05 timsar2

@timsar2 do you see this issue in v18? I don't see this behavior when I run ssr-irs from this repo, it has button and div, or maybe I misunderstood what you meant

maxisam avatar Aug 22 '24 16:08 maxisam