vocably / pontis

Painless Chrome extension authentication via AWS Amplify websites
MIT License
7 stars 0 forks source link

Unable to use the library #1

Closed bobthebuilder1997 closed 1 year ago

bobthebuilder1997 commented 2 years ago

Whenever I try to build my react project using this library I get below error and the build fails. This library seems unusable at the moment.

./node_modules/@vocably/pontis/dist/esm/app-auth-storage.js
SyntaxError: .\node_modules\@vocably\pontis\dist\esm\app-auth-storage.js: Missing class properties transform.      
  2 | import { removeItem, setItem, clear, getAll } from './extension-operations';
  3 | export class AppAuthStorage {
> 4 |     extensionId;
    |     ^^^^^^^^^^^^
  5 |     localStorage = new StorageHelper().getStorage();
  6 |     syncPromise = null;
  7 |     constructor(extensionId) {

My sample code in App.js

const extensionId = 'dhosfhjosidjfoidsjfiodsjffsfdsfdsfed';

 Auth.configure({
  storage: new AppAuthStorage(extensionId)
});
sneas commented 1 year ago

Hi @bobthebuilder1997, thank you for the issue and for the ⭐️

I'm sorry for the late reply, I haven't been watching this repo 🤦‍♂️

I'll provide a fix in a moment.

Just for the record. I'm using this project on top of Angular and it works well for me. Also, I've just tried it with the fresh create-react-app installation and it is also working. I suppose your current React setup doesn't like libraries that are compiled into esnext. I will compile it with an es6 target. This should fix the problem you are experiencing at the moment.

sneas commented 1 year ago

:tada: This issue has been resolved in version 1.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: