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

Bug - TypeError: Client is not a constructor #45

Closed
dbrennand opened this issue Jul 31, 2021 · 2 comments
Closed

Bug - TypeError: Client is not a constructor #45

dbrennand opened this issue Jul 31, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@dbrennand
Copy link
Contributor

Hi,

I just ran into an issue with the new version where the following error occurs: TypeError: Client is not a constructor.

Looking at census.client.ts the export class is in fact CensusClient.

I fixed this issue by doing the following:

import census from 'ps2census';
const { CensusClient, Events } = census;

const subscriptions = [{
    // Connery, Miller, Cobalt, Emerald, SolTech
    worlds: ['1', '10', '13', '17', '40'],
    characters: ['all'],
    eventNames: ['MetagameEvent'],
    logicalAndCharactersWithWorlds: true,
}];

// Initalise ps2census event stream client
const client = new CensusClient(serviceID, 'ps2', {
    streamManager: {subscriptions}
});
dbrennand added a commit to dbrennand/PS2Alert.me that referenced this issue Jul 31, 2021
@microwavekonijn
Copy link
Owner

microwavekonijn commented Jul 31, 2021

I forgot to update the examples again. As there are now 2 clients I renamed the Stream client to avoid conflict.

This was the last big refactor just so you know, might add features but names and formats will stay the same from now on.

@dbrennand
Copy link
Contributor Author

dbrennand commented Jul 31, 2021

I can submit a PR to fix the README example if you're ok with that? 😃

@microwavekonijn microwavekonijn added the documentation Improvements or additions to documentation label Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants