bug: New local plugin doesn't compile
See original GitHub issueBug Report
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 3.4.1 @capacitor/core: 3.4.1 @capacitor/android: 3.4.1 @capacitor/ios: 3.4.1
Installed Dependencies:
@capacitor/cli: 3.4.1 @capacitor/core: 3.4.1 @capacitor/android: 3.4.1 @capacitor/ios: 3.4.1
Platform(s)
N/A
Current Behavior
Newly created plugin should compile with npm run build
Expected Behavior
Compilation fails:
> test@0.0.1 build
> npm run clean && npm run docgen && tsc && rollup -c rollup.config.js
> test@0.0.1 clean
> rimraf ./dist
> test@0.0.1 docgen
> docgen --api testplPlugin --output-readme README.md --output-json dist/docs.json
✔️ DocGen Output: /frontend/app/testpl/dist/docs.json
✔️ DocGen Output: /frontend/app/testpl/README.md
../node_modules/@types/eslint-scope/node_modules/@types/eslint/helpers.d.ts:1:6 - error TS2300: Duplicate identifier 'Prepend'.
1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
~~~~~~~
../node_modules/@types/eslint/helpers.d.ts:1:6
1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
~~~~~~~
'Prepend' was also declared here.
../node_modules/@types/eslint/helpers.d.ts:1:6 - error TS2300: Duplicate identifier 'Prepend'.
1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
~~~~~~~
../node_modules/@types/eslint-scope/node_modules/@types/eslint/helpers.d.ts:1:6
1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
~~~~~~~
'Prepend' was also declared here.
Found 2 errors.
Code Reproduction
Create a new plugin with npm init @capacitor/plugin
, then run npm run build
Other Technical Details
NPM Version: 8.3.1 Node Version: v16.14.0 Tested on Mac
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Marketplace Plugin Compilation Troubleshooting
uplugin was not found in the submitted files. Declaration shadows a local variable, This is a warning our mac compilers flag as an...
Read more >Plugin doesn't work at all - WordPress.org
I just wanted to let you know that this plugin installs, but it doesn't work at all. When I add the demo content,...
Read more >Local Plugin Does Not Show Up on Test Server - Moodle.org
I am a beginner Moodle developer looking to build a plugin for my organization's LMS. To learn, I am taking the Moodle Plugin...
Read more >Maven build Compilation error : Failed to execute goal org ...
No matter how many times I build the project, i get the same error. Even after cleaning the project and refreshing it from...
Read more >Can't Run Plugins - Usage & Issues - Image.sc Forum
I downloaded Fiji and have been trying various different things to run the plugins but nothing seems to work. I either get an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@simonwalsh Add
"skipLibCheck": true
to the"compilerOptions"
section in the tsconfig.json for the plugin. This will disable typechecking node_modules, which seems to be the default for every React app I have worked on, so I think it is okay. Apparently it’s not set by default for capacitor plugins though.Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.