question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New WARNING coming from Amplify

See original GitHub issue

Describe the bug My AWS project uses aws-amplify/auth (1.0.8) and aws-amplify/analyics (1.0.9) and we’re getting a new warning message output into our test runs. This is slowing down the test runs quite a but.

 console.warn node_modules/@aws-amplify/core/lib/Logger/ConsoleLogger.js:78
    [WARN] 23:50.92 Hub - WARNING onHubCapsule is Deprecated. Please pass in a callback.

Expected behavior Since this warning is thrown from within amplify packages, I would assume that the packages need to be updated to no longer throw this warning internally.

Desktop (please complete the following information):

  • OS: MacOs
  • command line

Sample code

import { AnalyticsData } from "./types";

import Analytics from "@aws-amplify/analytics";

const context: { [s: string]: string } = {};

export const addAnalyticsContext = (newContext: { [s: string]: string }) => {
  Object.assign(context, newContext);
};

export const logAnalytics = (analyticsData: AnalyticsData, metrics?: Record<string, number>) => {
  const { name, ...attributes } = analyticsData;
  Analytics.record({ name, attributes: { ...context, ...attributes }, metrics });
};

and

import Auth from "@aws-amplify/auth";
import Analytics from "@aws-amplify/analytics";
import { getClientConfig } from "common/clientConfig";
import { addAnalyticsContext } from "common/analytics";
import { getUserId } from "common/utils/authUtils";

export const analyticsInit = () => {
  const analyticsConfig = getClientConfig().analytics;
  if (analyticsConfig) {
    const authConfig = { identityPoolId: analyticsConfig.identityPoolId, region: analyticsConfig.identityPoolRegion };
    const pinpointConfig = { appId: analyticsConfig.pinpointAppId, region: analyticsConfig.pinpointRegion };
    Auth.configure(authConfig);
    Analytics.configure(pinpointConfig);

    addAnalyticsContext({ beehiveId: getUserId() });
  }
};

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
alpjorcommented, Apr 12, 2019

No. It’s not by design. Please read my whole ticket. I’m not using onHubCapsule, amplify/auth is. This warning spits out thousands of times when we run your code.

On Apr 11, 2019, at 7:17 PM, Richard Threlkeld notifications@github.com wrote:

@alpjor hello this is by design. The functionality you see is an older style of embedding onHubCapsule into your code. To resolve this, please pass in an explicit callback rather than just passing in this as outlined in the docs: https://aws-amplify.github.io/docs/js/hub#working-with-the-api

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

2reactions
jordanranzcommented, Apr 12, 2019

@jkeys-ecg-nmsu,

I noticed that as well. Looks like the UI components have not yet been refactored for the Hub change. We will prioritize this refactor next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications - AWS Amplify Hosting
You can set up notifications for an AWS Amplify app to alert stakeholders or team members when a build succeeds or fails. Amplify...
Read more >
Project-level configurations - Troubleshooting guide
Warning: Once an application is deployed to the cloud using Amplify CLI the cloud resources like DynamoDB tables, Cognito Roles, or IAM policies...
Read more >
6–8 Science Curriculum - Phenomena Based ... - Amplify
... and real-world problems, develop and strengthen claims by collecting evidence and testing assumptions, and apply their learning in new contexts.
Read more >
Trying to get the Amplify CI/CD release process to deploy to a ...
2022-04-06T17:58:02.363Z [WARNING]: - Building resource api/myapi 2022-04-06T17:58:13.032Z [INFO]: GraphQL schema compiled successfully. Edit ...
Read more >
FEMA Integrated Public Alert and Warning Systems (IPAWS)
Weekly editorial newsletter covering the latest content, events and more taking place on NAB Amplify. Subscribe. © 2022 National Association of Broadcasters ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found