qwik icon indicating copy to clipboard operation
qwik copied to clipboard

DocumentHead meta, links, and styles break if array push is used

Open tuurbo opened this issue 1 year ago • 1 comments

Qwik Version

qwik 0.11.0, qwik city 0.0.112

Operating System (or Browser)

chrome

Node Version (if applicable)

stackblitz 16.14.2, local env 18.9.0

Which component is affected?

Qwik City

Expected Behaviour

Should render meta tags, link tags and styles correctly.

Actual Behaviour

No meta tags are displayed if you array push a tag onto the meta array. Breaks links and styles as well.

export const head: DocumentHead<any> = () => {
  let meta: DocumentMeta[] = [
    {
      property: 'og:title',
      content: 'title.........',
    },
  ];

  // push breaks meta tags
  meta.push({
    property: 'og:type',
    content: `type..........`,
  });

  // this works
  // meta = [
  //   ...meta,
  //   {
  //     property: 'og:type',
  //     content: `type..........`,
  //   }
  // ];

  return {
    title: 'Welcome to Qwik',
    meta,
  };
};

Additional Information

i tried updating the stackblitz to latest qwik versions but couldn't get npm start to run. Its a issue with latest versions of qwik regardless. https://stackblitz.com/edit/qwik-starter-vmbe8c?file=src%2Froutes%2Findex.tsx

tuurbo avatar Oct 13 '22 19:10 tuurbo