Vue-cli: Invalid options in vue.config.js: "baseUrl" is not allowed

Created on 8 Feb 2020  路  4Comments  路  Source: vuejs/vue-cli

Version

4.2.2

Environment info

 System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
  Binaries:
    Node: 11.13.0 - ~/.nvm/versions/node/v11.13.0/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v11.13.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 68.0.1
    Safari: 13.0.5
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.1.2 
    @vue/babel-preset-app:  4.2.2 
    @vue/babel-preset-jsx:  1.1.2 
    @vue/babel-sugar-functional-vue:  1.1.2 
    @vue/babel-sugar-inject-h:  1.1.2 
    @vue/babel-sugar-v-model:  1.1.2 
    @vue/babel-sugar-v-on:  1.1.2 
    @vue/cli-overlay:  4.2.2 
    @vue/cli-plugin-babel: ^4.2.2 => 4.2.2 
    @vue/cli-plugin-eslint: ^4.2.2 => 4.2.2 
    @vue/cli-plugin-router:  4.2.2 
    @vue/cli-plugin-vuex:  4.2.2 
    @vue/cli-service: ^4.2.2 => 4.2.2 
    @vue/cli-shared-utils:  4.2.2 (3.12.1)
    @vue/component-compiler-utils:  3.1.1 
    @vue/eslint-config-prettier: ^6.0.0 => 6.0.0 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^6.1.2 => 6.1.2 
    svg-to-vue:  0.6.0 
    vue: ^2.6.11 => 2.6.11 
    vue-cli-plugin-cordova: ^2.4.0 => 2.4.0 
    vue-cli-plugin-electron-builder: ^1.4.5 => 1.4.5 
    vue-context-menu: ^2.0.6 => 2.0.6 
    vue-electron: ^1.0.6 => 1.0.6 
    vue-eslint-parser:  7.0.0 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.8.3 
    vue-router: ^3.1.5 => 3.1.5 
    vue-style-loader:  4.1.2 
    vue-svg-loader: ^0.15.0 => 0.15.0 
    vue-template-compiler: ^2.6.11 => 2.6.11 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 4.2.2

Steps to reproduce

vue create my_app
vue ui
# Import project from current folder
# Go to config in vue ui & save
# Run the dev server by npm run serve from vue ui or CLI

What is expected?

No errors

What is actually happening?

Invalid options in vue.config.js: "baseUrl" is not allowed

cannot reproduce

Most helpful comment

I've tried myself. I thought baseUrl has replaced by publicPath. Here's the screenshot.

Screenshot

All 4 comments

Thanks for submitting this issue! Due to our limited time, we ask you to include a reproduction link to a minimal full reproduction of your problem (for example in a GitHub repository) so we can find what is causing the issue. Thank you for your understanding!

@sodatea This is not a coding issue, the problem is that vue ui still adds baseUrl to the vue config file on save, but it has been deprecated and replaced by publicPath.

See https://cli.vuejs.org/config/#baseurl

So because it is deprecated, vue cli will create an error by its own generated file ^^.

This can easily be fixed by changing vue ui to update vue config file by publicPath instead of baseUrl.

Can't reproduce. And I can't find any reference to baseUrl in the Vue CLI UI codebase.

I've tried myself. I thought baseUrl has replaced by publicPath. Here's the screenshot.

Screenshot

Was this page helpful?
0 / 5 - 0 ratings