Comments (6)
Awesome!
Side note: we're going to ship it as mode
instead of __mode
.
You can disable those log messages by providing the debug
property with false
if your mode is development
.
Please see our documentation around the debug
property
from analytics.
Ability to provide a custom isBrowser
and isDevelopment
value would be a cross-framework solution.
For example, SvelteKit provides both of them:
import { browser, dev } from '$app/environment';
from analytics.
Hey @hyunbinseo! Thank you for this detailed issue report!
We just published 0.1.6-beta.0
– you can install it via @vercel/analytics@beta
.
Version 0.1.6-beta.0
includes a new property called mode
. It allows you to bypass the existing logic in case we can't figure it out automatically.
Possible values for mode
:
auto
: default value if not defined – uses the existing logic to determine the right environmentdevelopment
: forces the local development mode – no data will be submittedproduction
: forces the production mode which sends data
Any chance you could give it a try?
from analytics.
Thank you for the quick fix. It works as expected.
import { browser, dev } from '$app/environment';
import { inject } from '@vercel/analytics';
inject({ __mode: dev ? 'development' : 'production' });
In a browser accessing a Vite dev server, the following message is logged.
[Vercel Analytics] Debug mode is enabled by default in development. No requests will be sent to the server.
I hope there is an option to override is-browser
and is-development
.
For example, SvelteKit provides both browser
and dev
boolean values.
import { browser, dev } from '$app/environment';
import { inject } from '@vercel/analytics';
inject({ browser, dev }); // example
If values are not explicitly provided, the library can decide on its own.
from analytics.
@chriswdmr v0.1.6 looks great.
Should this issue be closed? mode
still seems to be a workaround.
If all Vite projects still require the mode
property to be explicitly set,
- It should be clearly stated in the documentation's 'Other Frameworks' section
- or, the
isDevelopment
check should be improved to support Vite out of the box.
from analytics.
Perfect, thanks for confirmation.
Closing as it's resolved with v0.1.6
Documentation is already updated
from analytics.
Related Issues (20)
- Support for Arc Browser HOT 2
- User Opt in feature HOT 2
- Redirect / rename scripts? HOT 7
- Can't use server track in Remix HOT 5
- @vercel/analytics throws errors HOT 4
- Error 400 when using analytics/server track in server actions HOT 2
- Vercel build failed with Turborepo and multiple apps deployed HOT 5
- Vercel analytics data much higher than another analytics HOT 2
- Error: Cannot find module 'private-next-rsc-mod-ref-proxy' HOT 2
- HTTP 404 error for /_vercel/insights/script.js HOT 3
- 404 error in nuxt3 about _vercel/insights/script.js HOT 2
- Bug: all type imports not explicitly defined. `moduleResolution` setting required to import all types HOT 5
- Facing issues while deploying frontend on vercel HOT 1
- Usage in redirect routes HOT 8
- Referrers panel seems to not be getting data HOT 6
- Subdomain analytics HOT 6
- BeforeSend don't work in app directory RSC HOT 1
- Request Bodies with "o" Object Should be Encoded HOT 6
- Custom events does not work in the error boundary HOT 3
- Custom events from routes / SSR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics.