-
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Problem
Package.swift exists in the GitHub repository but is not included in the npm package because it's missing from the files field in package.json.
Evidence
The package.json files field currently only includes:
"files": [
"CapgoCameraPreview.podspec",
"android/",
"dist/",
"ios/"
]Package.swift is absent, so when Capacitor CLI runs cap sync, it warns:
[warn] @capgo/camera-preview does not have a Package.swift
[warn] Some installed packages are not compatible with SPM
And the plugin is excluded from the generated CapApp-SPM/Package.swift, causing a runtime error on iOS:
Error: "CameraPreview" plugin is not implemented on ios
Reproduction
- Create a Capacitor 8 project using SPM (default for Cap 8)
npm install @capgo/camera-previewnpx cap sync ios- Observe the warning and that
@capgo/camera-previewis missing fromCapApp-SPM/Package.swift
Fix
Add Package.swift to the files array in package.json:
"files": [
"Package.swift",
"CapgoCameraPreview.podspec",
"android/",
"dist/",
"ios/"
]Workaround
Manually copy Package.swift from the repo root into node_modules/@capgo/camera-preview/ after install. After doing this, cap sync picks it up correctly:
[info] All plugins have a Package.swift file and will be included in Package.swift
@capgo/camera-preview@8.1.1
Environment
@capgo/camera-preview: 8.1.1@capacitor/core: 8.1.0- Capacitor CLI: 8.x
- Package manager: pnpm
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels