Closed guychevelle closed 1 year ago
Get the same error when simply using the below:
Amplify.configure(config)
Hi @guychevelle
Amplify as a default export is deprecated and you would need to import it as a named export
import { Amplify } from 'aws-amplify'
Could you try this?
awesome! that works.
This tutorial should be updated: https://aws.amazon.com/blogs/mobile/use-existing-cognito-resources-for-your-amplify-api-storage-and-more/
I'm still getting this error applying :
import { Amplify } from 'aws-amplify'
ERROR in ./src/index.js 12:0-14 export 'default' (imported as 'Amplify') was not found in 'aws-amplify'
Full code
import logo from './logo.svg'; import './App.css';
import { Amplify } from 'aws-amplify' import { withAuthenticator, signOut } from '@aws-amplify/ui-react'
function App({ signOut }) { return (
Edit src/App.js
and save to reload.
); }
export default withAuthenticator(App);
import Amplify from 'aws-amplify'; import awsconfig from './aws-exports'; import { AmplifySignOut, withAuthenticator } from '@aws-amplify/ui-react';
Amplify.configure(awsconfig);
import logo from './logo.svg'; import './App.css';
import { Amplify } from 'aws-amplify' import { withAuthenticator, signOut } from '@aws-amplify/ui-react'
function App({ signOut }) { return (
); }
export default withAuthenticator(App);
Hi @akbarm, could you open a new issue for this and also share your package.json
?
Open new issue - https://github.com/aws-amplify/amplify-js/issues/new/choose
export 'API' (imported as 'API') was not found in 'aws-amplify' (possible exports: Amplify)
what about this issue??
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
DataStore
Amplify Categories
No response
Environment information
Describe the bug
Attempting to configure for multi auth (cognito and IAM) in index.js. This same code works with no issue for an application using aws-amplify 4.3.36.
Expected behavior
No errors when running npm start
Reproduction steps
index.js copied from an existing application that runs with no errors.
Code Snippet
// Put your logs below this line Compiled with problems:
ERROR in ./src/index.js 22:0-17
export 'default' (imported as 'Amplify') was not found in 'aws-amplify' (possible exports: API, APIClass, AWSCloudWatchProvider, AWSKinesisFirehoseProvider, AWSKinesisProvider, AWSPinpointProvider, AmazonPersonalizeProvider, Amplify, Analytics, Auth, AuthModeStrategyType, Cache, ClientDevice, DataStore, Geo, Hub, I18n, Interactions, Logger, Notifications, Predicates, Predictions, PubSub, ServiceWorker, Signer, SortDirection, Storage, StorageClass, XR, graphqlOperation, syncExpression, withSSRContext)