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

fix(vite.config): Duplicate Export #6227

Merged
merged 2 commits into from
May 5, 2024
Merged

fix(vite.config): Duplicate Export #6227

merged 2 commits into from
May 5, 2024

Conversation

PatrickJS
Copy link
Member

@PatrickJS PatrickJS commented May 5, 2024

this is caused by having duplicate deps in both devDeps and deps

fixes #6226

this is caused by having duplicate deps in both devDeps and deps
Copy link

cloudflare-workers-and-pages bot commented May 5, 2024

Deploying qwik-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 568102b
Status: ✅  Deploy successful!
Preview URL: https://0eae1b61.qwik-8nx.pages.dev
Branch Preview URL: https://fix-6226.qwik-8nx.pages.dev

View logs

@shairez
Copy link
Contributor

shairez commented May 5, 2024

LGTM
Thanks @PatrickJS ! 🙏

@PatrickJS PatrickJS enabled auto-merge (squash) May 5, 2024 18:14
@PatrickJS PatrickJS merged commit fc27771 into main May 5, 2024
24 checks passed
@PatrickJS PatrickJS deleted the fix-6226 branch May 5, 2024 18:26
@brandonpittman
Copy link
Contributor

brandonpittman commented Jun 13, 2024

@PatrickJS

After upgrading to 1.5.2, my build script spits out messages like this:

[plugin:vite:esbuild] [plugin vite:esbuild] ../shared/components/router-head/router-head.tsx: Duplicate key "dangerouslySetInnerHTML" in object literal
58 |                          return s.script;
59 |                      },
60 |                      dangerouslySetInnerHTML: _wrapSignal(s, "script")
   |                      ^
61 |                  }, null, 0, s.key))
62 |          ]

Any chance it's related to this fix?

@wmertens
Copy link
Member

@brandonpittman unfortunately that's a cosmetic side effect of a bugfix of the optimizer, and it's fixed in v2. We're focusing our efforts on v2 right now, it's hard to fix this in v1.

@brandonpittman
Copy link
Contributor

brandonpittman commented Jun 13, 2024

@brandonpittman unfortunately that's a cosmetic side effect of a bugfix of the optimizer, and it's fixed in v2. We're focusing our efforts on v2 right now, it's hard to fix this in v1.

@wmertens
Is there something I can do to workaround this? What’s causing the warnings to happen?

@PatrickJS
Copy link
Member Author

PatrickJS commented Jun 13, 2024

update RouterHead

export const RouterHead = component$(() => {
  const head = useDocumentHead();
  const loc = useLocation();

  return (
    <>
      <title>{head.title}</title>

      <link rel="canonical" href={loc.url.href} />
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      <link rel="icon" type="image/svg+xml" href="/favicon.svg" />

      {head.meta.map((m) => (
        <meta key={m.key} {...m} />
      ))}

      {head.links.map((l) => (
        <link key={l.key} {...l} />
      ))}

      {head.styles.map((s) => (
        <style
          key={s.key}
          {...s.props}
          {...(s.props?.dangerouslySetInnerHTML
            ? {}
            : { dangerouslySetInnerHTML: s.style })}
        />
      ))}

      {head.scripts.map((s) => (
        <script
          key={s.key}
          {...s.props}
          {...(s.props?.dangerouslySetInnerHTML
            ? {}
            : { dangerouslySetInnerHTML: s.script })}
        />
      ))}
    </>
  );
});

notice the bottom two are the ones thats different

{head.styles.map((s) => (
  <style
    key={s.key}
    {...s.props}
    {...(s.props?.dangerouslySetInnerHTML
      ? {}
      : { dangerouslySetInnerHTML: s.style })}
  />
))}

{head.scripts.map((s) => (
  <script
    key={s.key}
    {...s.props}
    {...(s.props?.dangerouslySetInnerHTML
      ? {}
      : { dangerouslySetInnerHTML: s.script })}
  />
))}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐞] Duplicate export on "npm run build.client"
4 participants