Comments (6)
What does your import statement look like? Do you have types for the library?
What does the error message look like?
Thanks,
Dan
from ionic-app-scripts.
@danbucholtz this happens on a clean new ionic project with just the official apollo initialization code added: http://dev.apollodata.com/angular2/initialization.html
Types are included in the library (there is no compilation error), error message in browser as quoted in my initial bug report.
I think you can easily reproduce it.
Of course this is a rollup issue. The problem: there is a lot of stuff which doesn't work with rollup so maybe there is a more general question here. Suggestion: have a fallback mechanism which can be activated for certain libraries to work around rollup limitations. Please also note discussions on the related apollo-client (and referenced rollup-commonjs) issues.
from ionic-app-scripts.
All,
We've posted some docs on the subject. Note: They match a version of @ionic/app-scripts
that will be dropped in the next day or so. 95% of the concepts still apply.
http://ionicframework.com/docs/v2/resources/third-party-libs/
http://ionicframework.com/docs/v2/resources/app-scripts/
Here's an example with AngularFire2.
Here is a project I implemented that has every library in it that Ionic users have reported trouble with. Most of the libraries worked, but a couple did not. Here is the summary of the findings.
Please let me know how everything goes. Since we posted documentation, we are going to close this issue.
I posted these issues in the apollo-client repo to get it to work with Ionic and Angular.
apollographql/apollo-client#746
apollographql/apollo-client#745
Thanks,
Dan
from ionic-app-scripts.
Thanks for the detailed work on this!
Just wanted to point out that there is still no way (even via script-tag due to lack of a build) to make apollo-client work with ionic rc0, contrary to what you state in the spreadsheet. (apparently you also commented it out in your example project)
from ionic-app-scripts.
Were you able to get the library built? If I could get it to compile, I can probably get it to work with Rollup. What is the error message that you're getting?
Thanks,
Dan
from ionic-app-scripts.
if you clone the apollo-client repo you can "npm run compile:browser" and it generates a build in the "dist" dir. i managed to adapt the deploy script so that it generates a valid npm package for this build file (which worked). using that i could fix another bug via the namedExports in rollup.config.js. apollo-client seems to work then. Problem is: apollo-client-rxjs generates the next problem (again circular dep as it seems):
RxApolloClient.js:5: Uncaught TypeError: Cannot read property 'prototype' of undefined
This library doesn't include a build script so i stopped following that path. What i did now is to fetch the sources of apollo-client, apollo-client-rxjs and angular2-apollo and fixed the circular deps and some version inconsistencies and used those custom versions in npm which for now works. is more a hack though. apollo-client is being refactored so i switch back to official once they are done.
from ionic-app-scripts.
Related Issues (20)
- Can't live reload an app added to the home screen in iOS Simulator
- TypeError: Cannot read property 'moduleType' of undefinded when build --prod
- Broken prod build chain - Cannot find type definition file for '@types' HOT 9
- Node 12 not supported
- "Environments" section of repo results in "ReferenceError" in new v4 app
- App-scripts is removed when I add a platform.
- Prepend Sass code on build time
- main.css miss some class
- Cannot find type definition file for β@typesβ HOT 2
- ion-segment doesn't refresh for hiding div <div *ngIf="isActive"> HOT 1
- Project not building
- Can't watch for changes of `src/index.html` on localhost HOT 1
- XML parsing Dependency migration
- Run a script after compilation
- Ionic v3 sass.config.js ignore excludeFiles regex HOT 1
- Dependency vulnerabilities "mem"
- unable to debug on ios device "ionic cordova run ios" missing .ts files
- node-sass Denial of Service
- Application Error net::err_proxy_connection_failed
- Transpile error using 3rd party library (xState)
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 ionic-app-scripts.