webpack-browser-plugin icon indicating copy to clipboard operation
webpack-browser-plugin copied to clipboard

"Google Chrome cannot read and write to its data directory" when flag "--user-data-dir" used

Open olehmelnyk opened this issue 7 years ago • 2 comments

I want to start a new browser window with --disable-web-security --user-data-dir="C:/Chrome dev session" flags, so I can work with CORS - when I write those flags in shortcut path or run it from the command line everything works fine, new browser window opens with CORS enabled and browser is started as a 'fresh install' due to the --user-data-dir="C:/Chrome dev session" flag

But when I run it from the webpack, I got a Windows error dialog:

---------------------------
Failed To Create Data Directory
---------------------------
Google Chrome cannot read and write to its data directory:

"C:/Chrome dev session"

here's how it set in webpack.config

plugins: [
    new browserPlugin({
        openOptions: {
            app: ['chrome', '--disable-web-security', '--user-data-dir="C:/Chrome dev session"']
        }
    })
]

olehmelnyk avatar Dec 21 '17 16:12 olehmelnyk

sorry, my bad - works fine once path wrapped with '--user-data-dir=' + path.resolve(path)

olehmelnyk avatar Dec 21 '17 16:12 olehmelnyk