question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: New local plugin doesn't compile

See original GitHub issue

Bug 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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

13reactions
Cyralcommented, Mar 25, 2022

@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.

0reactions
ionitron-bot[bot]commented, Nov 10, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found