apache / cordova-plugin-media-capture

Apache Cordova Media Capture Plugin
https://cordova.apache.org/
Apache License 2.0
307 stars 489 forks source link

Vite Rollup Error using plugin in react vite app #260

Closed aaronksaunders closed 1 year ago

aaronksaunders commented 1 year ago

Bug Report

Problem

What is expected to happen?

compile successfully

What does actually happen?

> tsc && vite build

vite v3.0.6 building for production...
✓ 17 modules transformed.
[vite]: Rollup failed to resolve import "@angular/core" from "node_modules/@awesome-cordova-plugins/media-capture/ngx/index.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "@angular/core" from "node_modules/@awesome-cordova-plugins/media-capture/ngx/index.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at onRollupWarning (file:///Users/aaronksaunders/Downloads/ionic-capacitor-react-vite-app-main/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:43675:19)
    at onwarn (file:///Users/aaronksaunders/Downloads/ionic-capacitor-react-vite-app-main/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:43465:13)
    at Object.onwarn (file:///Users/aaronksaunders/Downloads/ionic-capacitor-react-vite-app-main/node_modules/rollup/dist/es/shared/rollup.js:23178:13)
    at ModuleLoader.handleResolveId (file:///Users/aaronksaunders/Downloads/ionic-capacitor-react-vite-app-main/node_modules/rollup/dist/es/shared/rollup.js:22335:26)
    at file:///Users/aaronksaunders/Downloads/ionic-capacitor-react-vite-app-main/node_modules/rollup/dist/es/shared/rollup.js:22296:26

Information

vite/3.0.6 darwin-x64 node-v16.14.2 NodeJS : v16.14.2

Command or Code

Environment, Platform, Device

Mac m1

Version information

Capacitor CLI : 4.0.1 @capacitor/android : 4.0.1 @capacitor/core : 4.0.1 @capacitor/ios : 4.0.1

Checklist

erisu commented 1 year ago

This issue is not related to Cordova. We also do not own @awesome-cordova-plugins. Best to open a ticket for @awesome-cordova-plugins