Skip to content

Import on demand install fails without first preparing babel-plugin-import #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
n-smits opened this issue Apr 14, 2020 · 1 comment
Closed

Comments

@n-smits
Copy link

n-smits commented Apr 14, 2020

vue create antsy
> default (babel, eslint)
cd antsy
vue add ant-design
> Import on demand
> en_US

This fails for me in postinstall. (Fully import works.) Fixed with as per advanced guides from ant docs (npm i babel-plugin-import -D and modify babel.config.js before adding plugin).

EDIT: And furthermore, still needed to remove LocaleProvider from src/plugins/ though the install was was without errors (errors shown in dev tools console). 😕

Would you kindly update deps so it's not manual.

(Also, there are some prototype pollution warnings on npm audit)

Full error print out below (cleared funding and vulnerabilities notes).

Cheers :)

> vue add ant-design

📦  Installing vue-cli-plugin-ant-design...

+ [email protected]
added 1 package from 1 contributor and audited 25497 packages in 4.97s

(fund and vulnerabilities notes)

✔  Successfully installed plugin: vue-cli-plugin-ant-design

? How do you want to import Ant-Design-Vue? Import on demand
? Choose the locale you want to load en_US

🚀  Invoking generator for vue-cli-plugin-ant-design...
📦  Installing additional dependencies...

> [email protected] postinstall /Users/Nikola/dev/antsy/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> [email protected] postinstall /Users/Nikola/dev/antsy/node_modules/ant-design-vue
> node scripts/postinstall || echo "ignore"

added 68 packages from 93 contributors and audited 25642 packages in 5.029s

42 packages are looking for funding
  run `npm fund` for details

found 5 vulnerabilities (4 moderate, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
⠋  Running completion hooks...error: 'LocaleProvider' is not defined (no-undef) at src/plugins/ant-design-vue.js:3:15:
  1 | import Vue from 'vue'
  2 | import { Pagination, Button } from 'ant-design-vue'
> 3 | Vue.component(LocaleProvider.name, LocaleProvider)
    |               ^
  4 | Vue.component(Pagination.name, Pagination)
  5 | Vue.component(Button.name, Button)
  6 | 

error: 'LocaleProvider' is not defined (no-undef) at src/plugins/ant-design-vue.js:3:36:
  1 | import Vue from 'vue'
  2 | import { Pagination, Button } from 'ant-design-vue'
> 3 | Vue.component(LocaleProvider.name, LocaleProvider)
    |                                    ^
  4 | Vue.component(Pagination.name, Pagination)
  5 | Vue.component(Button.name, Button)
  6 | 

2 errors found.
wangxueliang added a commit that referenced this issue Apr 27, 2020
@wangxueliang
Copy link
Member

Please try again,tks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants