ionic-team / create-capacitor-plugin

Create a new Capacitor plugin ⚡️
Other
79 stars 11 forks source link

Follow Creating Capacitor Plugins,but app can't be built #74

Closed KevinKu closed 2 years ago

KevinKu commented 2 years ago

I followed this doc. Built a new plugin. But app installed the plugin , app could not be built.

error message


 ERROR  Failed to compile with 1 error                                                                       下午3:03:42

 error  in ../echo/dist/esm/index.js

Syntax Error: Error: Failed to load plugin '@typescript-eslint' declared in '..\echo\package.json » @ionic/eslint-config/recommended » ./index': Cannot find module '@typescript-eslint/eslint-plugin'
Require stack:
- D:\CapacitorPluginTest\hello-world\__placeholder__.js
Referenced from: D:\CapacitorPluginTest\echo\node_modules\@ionic\eslint-config\index.js
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at _normalizeObjectConfigData.next (<anonymous>)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at _normalizeObjectConfigData.next (<anonymous>)
    at _normalizeObjectConfigDataBody.next (<anonymous>)

 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js& 9:0-31 16:4-11
 @ ./src/App.vue?vue&type=script&lang=js&
 @ ./src/App.vue
 @ ./src/main.js
 @ multi ./src/main.js

 ERROR  Build failed with errors.
npm ERR! code 1
npm ERR! path D:\CapacitorPluginTest\hello-world
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c vue-cli-service build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2021-12-08T07_03_42_967Z-debug.log

Build Step

clone the project

"echo" is plugin. "hello-world" is app.

then

cd echo/
npm install
npm run build

and , go hello-world

cd ..
cd hello-world
npm install
npm run build

then , error is showed in terminal.

env

os : windows 10 x64 nodejs version : v14.17.3 npm version : 7.6.1

jcesarmobile commented 2 years ago

looks like https://github.com/ionic-team/create-capacitor-plugin/issues/55

can you check if my comment helps? https://github.com/ionic-team/create-capacitor-plugin/issues/55#issuecomment-925754393

KevinKu commented 2 years ago

Yes, it helps.

I upgrade @vue/cli from 4.5.15 to 5.0.0-rc.1.

Then,create a new vue project by 5.0.0-rc.1 vue cli.

Follow Build Step , and error message doesn't show.

jcesarmobile commented 2 years ago

Ok, thanks for checking, closing then.