Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.8.0 does not work in Android Cordova App #125

Open
clmorales opened this issue Feb 2, 2019 · 7 comments
Open

Version 1.8.0 does not work in Android Cordova App #125

clmorales opened this issue Feb 2, 2019 · 7 comments

Comments

@clmorales
Copy link

clmorales commented Feb 2, 2019

I have an Android app using cordova and Aurelia. The app uses aurelia-fetch-client 1.3.1. When I tried to create a new app using aurelia-fetch-client 1.8.0 the does not start on device. Error log shows io.cordova.hellocordova I/chromium: [INFO:CONSOLE(12730)] "Uncaught SyntaxError: Unexpected token {", source: file:///android_asset/www/scripts/vendor-bundle.js (12730)

When I downgrade the version to 1.3.1 it works fine again.

@bigopon
Copy link
Member

bigopon commented Feb 2, 2019

@clmorales Thanks for filing this. Can you help try with a lower version of fetch client? Maybe 1.8.0 or 1.7.0?

@clmorales
Copy link
Author

Hi I tried Version 1.7.0 and It Works, so the problem it is on 1.8.0 only.

@clmorales clmorales changed the title Version 1.8.1 does not work in Android Cordova App Version 1.8.0 does not work in Android Cordova App Feb 2, 2019
@bigopon
Copy link
Member

bigopon commented Feb 2, 2019

@clmorales I think you are probably get similar issues with this aurelia/path#29

But that guess could incorrect if the Android Webview supports newer features of JavaScript. It's still worth a try and test. Can you give a bit more info about the environment where it got the error?

@doktordirk
Copy link
Contributor

@bigopon not sure if it helps, but we have (stupidly) export class ApiClient extends HttpClient { and that stopped working in 1.8.0 with hmm HttpClient needs to be create with new or so

@bigopon
Copy link
Member

bigopon commented Feb 12, 2019

@doktordirk Could you help with a simple snippet or repro and somemore details on how it fails? I think I'm a bit confused what kind of issues you are running into.

@doktordirk
Copy link
Contributor

Message: Class constructor HttpClient cannot be invoked without 'new'
Inner Error Stack:
TypeError: Class constructor HttpClient cannot be invoked without 'new'    
at new ApiClient (http://localhost:8080/static/webpack/commons.bundle.js?v=2c0c4b27cccd6e20f740f77a3f752d1a62d23077:84999:63)    
export class ApiClient extends HttpClient {
  constructor() {
    super();

    this.configure(config => {
      config
        .useStandardConfiguration()

babel 6 transpiled

var ApiClient = exports.ApiClient = function (_HttpClient) {
	  _inherits(ApiClient, _HttpClient);
	
	  function ApiClient() {
	    _classCallCheck(this, ApiClient);
	
	    var _this = _possibleConstructorReturn(this, _HttpClient.call(this));   /// <--- line  84999
	
	    _this.configure(function (config) {
	      config.useStandardConfiguration().withBaseUrl(API_BASE).withDefaults({
	```

@doktordirk
Copy link
Contributor

@bigopon retried with babel 7 and there it works with 1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants