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.

Beta 25 breaks ionic/pwa-elements camera modal

See original GitHub issue

Description of the problem: It seems capacitor beta.25 breaks the camera plugin using ionic/pwa-elements with an ionic/angular project. When I update to beta 25 I receive the following error: TypeError: cameraModal.present is not a function error.

If i revert to beta.24 it works again as expected.

Affected platform

  • Android
  • iOS
  • electron
  • [ X ] web

OS of the development machine

  • Windows
  • [ X ] macOS
  • linux

Other information: I am using the implementation described below. https://stenciljs.com/docs/angular/

Capacitor version: Beta 25 node version: v10.15.3 npm version: 6.9.0

Steps to reproduce: Install Camera plugin on ionic/angular 4.4.0 project. Integrate ionic/pwa-elements. Call the Camera.getPhoto() function. Get error. TypeError: cameraModal.present is not a function error.

Downgrade to beta.24 and it all works.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
jcesarmobilecommented, May 24, 2019

Looks like you have the docs cached. The angular instructions in that link are

Angular

main.ts:

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import { defineCustomElements } from '@ionic/pwa-elements/loader';

if (environment.production) {
 enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
 .catch(err => console.log(err));

// Call the element loader after the platform has been bootstrapped
defineCustomElements(window);

So exactly what you did

1reaction
mlynchcommented, May 23, 2019

The animation thing is temporary and will be coming back

Read more comments on GitHub >

github_iconTop Results From Across the Web

unable to load pwa element 'pwa-camera-modal'
This UI is implemented using web components. Due to the magic of Shadow DOM, these components should not conflict with your own UI....
Read more >
failed to fetch dynamically imported module vue3 - You.com
Unable to cache pwa-camera-modal.entry.js. TypeError: Failed to fetch dynamically imported module: yarn add @ionic/pwa-elements. boot/capacitor.ts.
Read more >
capacitor/core - UNPKG
core-plugin-definitions';\n//import '@ionic/pwa-elements';\nvar CameraPluginWeb = /** @class ... createElement('pwa-camera-modal');\n document.body.
Read more >
PWA Elements | Capacitor Documentation
To enable these controls, you must add @ionic/pwa-elements to your app. A typical installation involves importing the package and registering the elements, or ......
Read more >
Common Issues with Poor Performance in Ionic Applications
The Camera API is one example of this. If we install the @ionic/pwa-elements package, we can launch a camera modal that will allow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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