#Navigation using Link component not working after building

13 messages · Page 1 of 1 (latest)

last marten
#

Links work fine during development but break after building the project.

I get an error message complaining about a map function not existing on an array.

#

Refers to this chunk:

last marten
#

I am not doing anything fancy, just wrapping the Link component to add some conditional tailwind styles in a component, all I add are css classes.

#

Replacing <Link> with <a> for now

last marten
#
export const ExtLink = component$<Props>(({ href, cssClass, target, type = 'simple', title }) => {
  const linkType = {
    info: 'link link-info link-hover',
    warning: 'link link-warning link-hover',
    error: 'link link-error link-hover',
    success: 'link link-success link-hover',
    primary: 'link link-primary link-hover',
    secondary: 'link link-secondary link-hover',
    accent: 'link link-accent link-hover',
    neutral: 'link link-neutral link-hover',
    simple: 'link link-hover',
    element: 'w-full h-full flex items-center justify-center link-hover',
  };

  return (
    <Link href={href} target={target} title={title} class={`${linkType[type]} ${cssClass}`}>
      <Slot />
    </Link>
  );
});
last marten
#

This seems to be an error coming from code which is part of vite 5. I will try to investigate further.

last marten
#

I added a patch in the mentioned issue that resolves it at the root (vite), from what I can tell.

bold pumice
#

@last marten this is still a thing right? I was wondering if you fixed it woithout patching it. Should we as the vite guys to take a look?

last marten
bold pumice
#

Oh my, I updated vite and qwik and deleted all build files and it’s gone as well. Thanks for the qwik answer 🙌

last marten
#

Yeah, sometimes time itself solves the issue, lol

bold pumice
#

Time solves all the problems 😄
If someone dies all the problems are gone or delegated to someone else 😄