{"id":20804,"library":"webpack-open-browser","title":"WebpackOpenBrowser","description":"Webpack plugin to automatically open a browser when webpack's dev server starts. Current stable version is 2.0.2, supports webpack >=4.0.0 <6.0.0. Uses the 'open' package for cross-platform browser launching, including incognito mode via arguments. Differentiators: supports multiple URLs/browsers via array config, delay option, ignore errors option, and includes built-in cross-platform browser name constants for Chrome, Firefox, and Edge. The package ships TypeScript types.","status":"active","version":"2.0.2","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/tjx666/webpack-open-browser","tags":["javascript","webpack","plugin","open","browser","typescript"],"install":[{"cmd":"npm install webpack-open-browser","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-open-browser","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-open-browser","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin use","package":"webpack","optional":true},{"reason":"used for opening URLs in browsers","package":"open","optional":false}],"imports":[{"note":"Named export, not default. In CJS use const { WebpackOpenBrowser } = require('webpack-open-browser'). Since v2.0.0 ESM is supported.","wrong":"import WebpackOpenBrowser from 'webpack-open-browser'","symbol":"WebpackOpenBrowser","correct":"import { WebpackOpenBrowser } from 'webpack-open-browser'"},{"note":"the apps object is a named export containing browser constants like apps.chrome, apps.firefox, apps.edge.","wrong":"const apps = require('webpack-open-browser').apps","symbol":"apps","correct":"import { apps } from 'webpack-open-browser'"},{"note":"TypeScript type export available since v2.0.0. Use for type-checking options.","symbol":"type WebpackOpenBrowserOptions","correct":"import type { WebpackOpenBrowserOptions } from 'webpack-open-browser'"}],"quickstart":{"code":"// webpack.config.js\nconst { WebpackOpenBrowser } = require('webpack-open-browser');\n\nmodule.exports = {\n  plugins: [\n    new WebpackOpenBrowser({ url: 'http://localhost:3000' }),\n  ],\n};","lang":"javascript","description":"Demonstrates the minimal setup: import the plugin and add it to the plugins array with a URL."},"warnings":[{"fix":"Use const { WebpackOpenBrowser } = require('webpack-open-browser') or import { WebpackOpenBrowser } from 'webpack-open-browser'.","message":"In v2.0.0, the import path changed from default export to named export. If still using 'const WebpackOpenBrowser = require('webpack-open-browser').default' it will break.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Use apps.chrome (cross-platform) or the full application name for your OS (e.g., 'Google Chrome' on Mac, 'chrome' on Windows).","message":"The browser option is platform-dependent. Using 'chrome' on MacOS won't work; use 'Google Chrome' or apps.chrome instead.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set the option ignoreErrors: true to open the browser even if there are compilation errors.","message":"The plugin only works by default when there are no compilation errors. If errors exist, the browser won't open.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"N/A","message":"Passing plugins as array elements with new keyword for each option group is the only supported syntax. There is no deprecated usage.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install webpack-open-browser --save-dev.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'webpack-open-browser'"},{"fix":"Use const { WebpackOpenBrowser } = require('webpack-open-browser');","cause":"Using a default import when the package only exports named exports.","error":"TypeError: WebpackOpenBrowser is not a constructor"},{"fix":"Use apps.chrome or 'Google Chrome' (full application name) for MacOS.","cause":"On MacOS, 'chrome' is not a recognized application name.","error":"The provided value 'chrome' is not a valid browser from 'apps'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}