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

amplify-s3-album not working for ionic #284

Closed
samira-zarandioon opened this issue Dec 6, 2018 · 3 comments
Closed

amplify-s3-album not working for ionic #284

samira-zarandioon opened this issue Dec 6, 2018 · 3 comments

Comments

@samira-zarandioon
Copy link

When I use the following code snippet, I get a null pointer exception:

<amplify-s3-album framework="Ionic" 
    path="pics" (selected)="onAlbumImageSelected($event)">
</amplify-s3-album>

Exception:

TypeError: Cannot read property 'provider' of undefined
    at StorageClass.<anonymous> (Storage.js:215)
    at step (Storage.js:44)
    at Object.next (Storage.js:25)
    at Storage.js:19
    at new ZoneAwarePromise (zone.js:891)
    at push../node_modules/@aws-amplify/storage/lib/Storage.js.__awaiter (Storage.js:15)
    at StorageClass.push../node_modules/@aws-amplify/storage/lib/Storage.js.StorageClass.list (Storage.js:212)
    at S3AlbumComponentIonic.push../node_modules/aws-amplify-angular/dist/src/components/storage/s3-album-component/s3-album.component.core.js.S3AlbumComponentCore.getList (s3-album.component.core.js:47)
    at S3AlbumComponentIonic.push../node_modules/aws-amplify-angular/dist/src/components/storage/s3-album-component/s3-album.component.core.js.S3AlbumComponentCore.ngOnInit (s3-album.component.core.js:39)
    at checkAndUpdateDirectiveInline (core.js:18537)

It's failing at this line at Storage.js:

                _a = (config.provider || {}).provider, provider = _a === void 0 ? DEFAULT_PROVIDER : _a;

It seems config is pointing to the option parameter. To avoid this issue, I had to set the option parameter to an empty object:

  <amplify-s3-album framework="Ionic" path="pictures" options="{level: 'public'}"
    (selected)="onAlbumImageSelected($event)"
    >
  </amplify-s3-album>

However, still the images do not show up. Any idea?

@frankmuellr frankmuellr added the amplify/js Issues tied to JS label Dec 6, 2018
@nikhil-dabhade
Copy link
Contributor

@samira-zarandioon : Sorry to hear that you are running in this issue. Are you still blocked on this?

@stale
Copy link

stale bot commented Jun 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jun 22, 2019

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@stale stale bot closed this as completed Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants