Comments (11)
Just found a solution to get around this... you can add a path mapping for @ionic/core
to tsconfig.json
so that it resolves @ionic/core
to the same path for both your project and @ionic/pwa-elements
:
{
"compilerOptions": {
// ...
"baseUrl": ".", // needed to make "paths" work
"paths": {
"@ionic/core": ["node_modules/@ionic/core"]
}
}
}
I have a suggestion for a better and cleaner solution though, that would be a bit of a breaking change but solve this long-term: make Ionic an external dependency. That would mean that when including @ionic/pwa-elements
as a script, @ionic/core
would have to be included first. When using it in a project, @ionic/core
should be a peer dependency. Because of how Ionic components are lazy-loaded, I think this approach would work fine. If agreed, I can try and make a PR for that (/cc @mlynch @mhartington)?
from pwa-elements.
Hey all, we're working on some changes that should permanently fix this. Stay tuned.
from pwa-elements.
Just found a solution to get around this... you can add a path mapping for
@ionic/core
totsconfig.json
so that it resolves@ionic/core
to the same path for both your project and@ionic/pwa-elements
:{ "compilerOptions": { // ... "baseUrl": ".", // needed to make "paths" work "paths": { "@ionic/core": ["node_modules/@ionic/core"] } } }I have a suggestion for a better and cleaner solution though, that would be a bit of a breaking change but solve this long-term: make Ionic an external dependency. That would mean that when including
@ionic/pwa-elements
as a script,@ionic/core
would have to be included first. When using it in a project,@ionic/core
should be a peer dependency. Because of how Ionic components are lazy-loaded, I think this approach would work fine. If agreed, I can try and make a PR for that (/cc @mlynch @mhartington)?
Thanks @simonhaenisch . It works for me.
from pwa-elements.
@simonhaenisch we do want to get back to that point, and it should work. Just given everyone's time it wasn't going to work before we hit 1.0 so we needed to punt on that. There's some compiler work still to be done first.
from pwa-elements.
Do we have an update on this?
from pwa-elements.
Workaround for us was to use selective dependency resolutions with yarn
package.json
"resolutions": { "@ionic/core": "4.3.0" },
from pwa-elements.
Ran into this issue today as well.
from pwa-elements.
Thanks @simonhaenisch that fixes it for me!
from pwa-elements.
Does changing this to use peerDependencies
resolve it?
from pwa-elements.
Just saw that you removed Ionic completely... that's another way of making it work 😄 I liked the idea of it being an extension of Ionic (i. e. it would be able to use ion-toast
), however there doesn't seem to be a simple way of maintaining that.
from pwa-elements.
as 1.1.0 doesn't use @ionic/core, this can be closed
from pwa-elements.
Related Issues (20)
- cancel photo click raise uncaught exception on web
- camera - after pressing on take picture button it takes 1-2s to output the image HOT 7
- Unable to load dynamic imports with vite HOT 24
- Ability for the Camera to choose between multiple rear cameras
- feat: Possibility to translate in the camera plugin when it does not exist. HOT 3
- Vue Support?
- Documentation not in line with Ionic 7 HOT 1
- bug: unexpected token when parsing module HOT 5
- Unable to use in esm package. Module not found: Can't resolve '@ionic/pwa-elements/loader/index.js'
- The default camera should be Rear not Front HOT 2
- The Rear camera is not working on devices with multiple cameras HOT 1
- Switching camera (e.g. Front to Rear) is not working in Safari
- Switching between front and rear cameras causes Chrome to freeze on Android 11 HOT 2
- feat: Camera should allow for additional `accept` types for file selection
- source configuration. not working. can't enable for CameraSource.Camera / CameraSource.Photos HOT 3
- A /undefined request is made when taking a photo HOT 1
- Question: is that possible to force the use of PWA elements on Android Capacitor App ? HOT 4
- Tool request: provide a codesandbox example to easily test PWA elements components
- Show loading during image capture HOT 2
- Camera breaks on modal close on web HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pwa-elements.