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

Response property doesn't exist on FileUploadResult. #1002

Closed
dragonfire1119 opened this issue Jan 25, 2017 · 11 comments
Closed

Response property doesn't exist on FileUploadResult. #1002

dragonfire1119 opened this issue Jan 25, 2017 · 11 comments
Assignees
Labels

Comments

@dragonfire1119
Copy link

dragonfire1119 commented Jan 25, 2017

Error

Property 'response' does not exist on type 'FileUploadResult | FileTransferError'.

fileTransfer.upload(targetPath, url, options).then(data => {
     let response = JSON.parse(data.response);
});

I was on "ionic-native": "^2.2.11" but I upgraded to "ionic-native": "^2.4.1",

Looks like the error is happening on this commit:
1976c38#diff-2f9b79bc9c725972a5f02017d72a1e66R226

Steps to resolve error

I did delete the node_modules & reinstall everything.

Looked for the the response https://github.com/driftyco/ionic-native/blob/master/src/plugins/filetransfer.ts#L66

Versions

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0

@ihadeed ihadeed self-assigned this Jan 25, 2017
@ihadeed ihadeed added the bug label Jan 25, 2017
@phoenixtrigo
Copy link

Hi guys!

It happens to me right now and I already deleted node_modules and do npm install and same error.

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0

@dragonfire1119
Copy link
Author

@ihadeed Since you closed this is it going to be released?

@sjosen
Copy link

sjosen commented Jan 30, 2017

I have the same error

@dragonfire1119
Copy link
Author

@sjosen Until he releases the commit you would need to go back to "ionic-native": "2.2.11".

@betollaque
Copy link

I have the same error with ionic-native": 2.4.1, Please when will be ready this release?
@dragonfire1119 Could you explain how you solved temporally this error?

@dragonfire1119
Copy link
Author

@betollaque you would need to change your ionic native version to "ionic-native": "2.2.11".

@phoenixtrigo
Copy link

@betollaque I solved by applying the fix manually. Not the best solution but it does the job until the new release are out.

@betollaque
Copy link

Thanks guys for help. @phoenixtrigo I found 2 files in my ionic project:

  • node_modules\ionic-native\dist\es5\plugins\filetransfer.d.ts

  • node_modules\ionic-native\dist\esm\plugins\filetransfer.d.ts

Both files have this line: upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult | FileTransferError>;

Here I'm little confuse, could you indicate what file and line did you fix?

@ihadeed
Copy link
Collaborator

ihadeed commented Feb 2, 2017

@betollaque remove | FileTransferError from there and it will work.

@betollaque
Copy link

Is working! thanks!

@phoenixtrigo
Copy link

@betollaque glad to hear it's working now.

I think the file depends on the target you have configured on the tsconfig.ts file.
If "target": "es5" then node_modules\ionic-native\dist\es5\plugins\filetransfer.d.ts
If "target": "esm" then node_modules\ionic-native\dist\esm\plugins\filetransfer.d.ts

then it's just like @ihadeed said, remove the | FileTransferError from the corresponding file.

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

No branches or pull requests

5 participants