You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Bowser from "bowser";
...
const browser = Bowser.getParser(window.navigator.userAgent);
console.log(`The current browser name is "${browser.getBrowserName()}"`);
// The current browser name is "Chrome"
With tree-shaking:
import { getParser } from "bowser";
const browser = getParser(window.navigator.userAgent);
console.log(`The current browser name is "${browser.getBrowserName()}"`);
Output: Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/bowser.js?v=8b59587e' does not provide an export named 'getParser'
vite: 2.9.1
bowser: 2.11.0
The text was updated successfully, but these errors were encountered:
Default example:
With tree-shaking:
Output:
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/bowser.js?v=8b59587e' does not provide an export named 'getParser'
vite: 2.9.1
bowser: 2.11.0
The text was updated successfully, but these errors were encountered: