Using Yarn workspaces results in: Error: method not available in web
See original GitHub issueDescribe the bug
All methods yield just Error: method not available in web
.
To Reproduce
Use any methods of the plugin.
EDIT: I’m using just prepare
, hide/show-Background
and startScan
methods.
Version
I’m using Capacitor.js@2.4.7 and @capacitor-community/barcode-scanner@1.2.1, here is the full list of yarn cap doctor
💊 Capacitor Doctor 💊
Installed Dependencies:
@capacitor/cli 2.4.7
@capacitor/core 2.4.7
@capacitor/android 2.4.7
@capacitor/ios 2.4.7
@capacitor/electron not installed
[success] Android looking great! 👌
Found 10 Capacitor plugins for ios:
@capacitor-community/barcode-scanner (1.2.1)
capacitor-dark-mode (1.0.5)
capacitor-plugin-ios-swipe-back (1.0.3)
capacitor-rate-app (0.1.1)
capacitor-secure-storage-plugin (0.5.0)
cordova-plugin-appcenter-crashes (0.5.1)
cordova-plugin-appcenter-shared (0.5.1)
cordova-plugin-fingerprint-aio (4.0.2)
cordova-plugin-inappbrowser (5.0.1-dev)
onesignal-cordova-plugin (2.11.3)
[success] iOS looking great! 👌
Desktop (please complete the following information):
I’m using Yarn@1 with workspaces feature in a monorepo.
System:
OS: macOS 11.4
CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
Memory: 439.66 MB / 32.00 GB
Shell: 3.1.2 - /usr/local/bin/fish
Browsers:
Brave Browser: 89.1.21.77
Chrome: 91.0.4472.114
Edge: 91.0.864.54
Firefox: 85.0.2
Safari: 14.1.1
Smartphone (please complete the following information):
Tested on one physical device
- Device: Samsung SM-J330F
- OS: Android 8.0
- WebView implementation with Chrome 91.0.4472.120
And on an Apple simulator
- Device: iPhone 11
- OS: iOS 14.5
And on an Android emulator
- Device: Pixel 3
- OS: Android 11
Additional context I read the logs for anything “barcode” related but no trace of warning/error. I also double-checked the setup and all seems to be OK.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Yarn Workspaces, workspace does not emit errors or warnings
For some reason if I use error boundaries I get an error: Failed to load config "./node_modules/kcd-scripts/eslint.js" to extend from.
Read more >Workspaces - Yarn
Workspaces are a new way to set up your package architecture that's available by default starting from Yarn 1.0. It allows you to...
Read more >Support yarn workspaces (better indexing of node_modules ...
What steps will reproduce the problem? 1. Create a multi-package workspace project with yarn workspaces 2. Try and import code between different projects, ......
Read more >JavaScript package managers compared: npm, Yarn, or pnpm?
The following tables compare a curated set of different CLI commands available in npm, Yarn Classic, Yarn Berry, and pnpm. This is by...
Read more >module-not-found - Next.js
Why This Error Occurred · The module you're trying to import is not installed in your dependencies · The module you're trying to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
@NicoP-S Hi, mostly you are using documentation for the new version to implement the old version you are using capacitor v2 https://github.com/NicoP-S/barcodescan/blob/master/src-capacitor/package.json#L11
so you need to use this documentation https://github.com/capacitor-community/barcode-scanner/tree/release/v1.3.0
fast fix steps need to do
in your main activity
the calling of BarcodeScanner is not as v3 instead of
import { BarcodeScanner } from '@capacitor-community/barcode-scanner';
useWould you be able to, instead of sharing the whole repo, share a minimal reproduction repo (with any confidential code stripped out)