Skip to content

fix: userAgent error on CF #14

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

Merged
merged 2 commits into from
Apr 3, 2024
Merged

fix: userAgent error on CF #14

merged 2 commits into from
Apr 3, 2024

Conversation

atinux
Copy link
Contributor

@atinux atinux commented Apr 3, 2024

Resolves #6

It is not related to createSharedComposable but from Unovis used in https://github.com/nuxt-ui-pro/dashboard/blob/main/components/home/HomeChart.vue#L3

Unovis uses a polyfill for the resize observer: https://github.com/f5/unovis/blob/af5f4e44c9bd534b69462801b85a5d40a68d6493/packages/ts/src/utils/resize-observer.ts#L2

As it ResizeObserver does not exists on edge environment and because we cannot have external in a worker, it adds the polyfill with the IIFE format which is wrongly transformed to:

var IE = (/msie|trident/i).test(globalThis.navigator && global.navigator.userAgent);

See source

The only quick solution I found is to split the HomeChart component for now, best would be to have a Chart component for it using Unoviz in the future or in this PR (I let @benjamincanac decides for it)

Copy link

vercel bot commented Apr 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ui-pro-template-dashboard ✅ Ready (Inspect) Visit Preview Apr 3, 2024 8:25am
Copy link

cloudflare-workers-and-pages bot commented Apr 3, 2024

Deploying dashboard-w1c0 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 516f2f6
Status:⚡️  Build in progress...

View logs

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