docs icon indicating copy to clipboard operation
docs copied to clipboard

DEFAULT_USE_DUALSTACK_ENDPOINT not exported from @aws-sdk/config-resolver

Open rwmorton opened this issue 4 years ago • 6 comments

Attempted import error: 'DEFAULT_USE_DUALSTACK_ENDPOINT' is not exported from '@aws-sdk/config-resolver'

I am following the Amplify tutorial, my React app works fine (via create-react-app). As soon as I include "import Amplify from 'aws-amplify'; I get the above error:

Here is my App.js file:

import Amplify from 'aws-amplify';

function App()
{
  return (
    <div>
      <h1>Notes App</h1>
    </div>
  )
}

export default App;

Full error is below:

./node_modules/@aws-sdk/client-location/dist-es/runtimeConfig.browser.js Attempted import error: 'DEFAULT_USE_DUALSTACK_ENDPOINT' is not exported from '@aws-sdk/config-resolver'.

rwmorton avatar Dec 13 '21 14:12 rwmorton

Hi @rwmorton, thanks for opening. Do you remember what page this was referenced in the docs? https://docs.amplify.aws/start/getting-started/setup/q/integration/react/ maybe?

siegerts avatar Dec 13 '21 15:12 siegerts

@siegerts Thanks for getting back to me, I was following this one:

https://aws.amazon.com/getting-started/guides/deploy-webapp-amplify/module-two/

The setup looks identical to the one you have posted.

rwmorton avatar Dec 13 '21 15:12 rwmorton

Having the same problem here. Any update?

shibaozhang95 avatar Jan 04 '22 00:01 shibaozhang95

@rwmorton Wasn't able to reproduce this exact error with a new amplify project using CRA v5 but that tutorial does look outdated. The getting started guide from the amplify docs site @siegerts linked would be the best way to get started

What version of CreateReactApp/react-scripts might you be using?

I noticed the tutorial doesn't mention installing aws-amplify but I think that error suggests you did install it so that might not be the issue, but double check you have the latest version of that package installed.

Otherwise, so far the only other thing I noticed with the tutorial is that it is trying to import AmplifySignOut from the @aws-amplify/ui-react package but that component is no longer exported in the latest version.

That would result in a different error.

You'd have to install v1 of the ui library to access that component by running npm install @aws-ampliy/[email protected] (any version >= 1.0.0 should work, no particular reason I chose 1.2.2)

chrisbonifacio avatar Jan 04 '22 16:01 chrisbonifacio

Happening for me too. I've had no problems for a year, but now only 1 of my dev PCs shows this error any time I try to run or build my app. I've tried rebuilding node_modules, upgrading all npm packages, reinstalling all global packages, etc.

How would I debug such a problem?

kenmckaba avatar Jan 26 '22 08:01 kenmckaba

@kenmckaba @shibaozhang95 @rwmorton Any of you found what is causing this issue. I am trying to run a ReactApp and I am facing the same issue. Windows - Node - 16.5.0, Amplify/ui-react 2.1.5. I would appreciate any pointers. This is a brand new node installation and this is the first app I am trying to run.

santhotech avatar Jun 08 '22 14:06 santhotech

Hi @kenmckaba @santhotech previously, the guide showed to import Amplify from the default export, however that has now been deprecated, and you would need to import from named export as the updated guide shows.

import { Amplify } from 'aws-amplify'

Further, I haven't been able to reproduce this issue. Are you still facing this issue? If so, we may need to transfer this to the relevant repo.

nadetastic avatar Nov 15 '22 14:11 nadetastic