Closed jkeys-ecg-nmsu closed 5 years ago
@jkeys-ecg-nmsu aws-sdk@2.9.0 is from 2 years ago, probably that doesn't have lexRuntime, aws-amplify has aws-sdk as dependency (2.329.0). I suggest to not include aws-sdk as a dependency of your app. Let me know how it goes.
@elorzafe My app is embedding a Sumerian scene that uses Amplify's version of aws-sdk, will Sumerian still have access to aws-sdk (without tree-shaking away all the services I need in Sumerian) if it's not a direct dependency?
You can import aws-sdk like this (the one that uses amplify library)
import { AWS } from "@aws-amplify/core/lib/Facet";
Thanks for your help. We ended up resolving the issue by bootstrapping a new React app with FB's create-react-app
(as opposed to simple-react-app
which is what I had used to bootstrap this app previously) and copying over our source including Amplify files.
@elorzafe My new app has the amplify
directory and .amplifyrc
; I also noticed that one of the Amplify config files has an absolute path to the project directory. If I checkout my Amplify app -- we're using CodeCommit for our source control and have decided that we're not going to .gitignore
any amp files -- and update that path, should I be in a valid Amplify project directory at that point?
@jkeys-ecg-nmsu that shouldnt be an issue, when you run amplify init
it will add to .gitignore
what is not required by the cli. In case the cli doesnt work, you can run amplify init
again and that will solve the issue.
@elorzafe Ah fair enough, for whatever reason I got the impression that amplify init
is not idempotent. I manually edited project-config.json
when checked out on a different machine and amplify publish
worked. It looks like that file's the only one that contains anything specific to a given machine. Is it possible to turn the absolute path for projectPath
into a relative path? (So anyone with git access could checkout an Amplify project and do e.g. amplify publish
without having to run amplify init
. Or, maybe check to see if the project contains Amplify folders/files on any command besides amplify init
, and ask to re-initialize the project if they exist?)
@jkeys-ecg-nmsu have you tried multi-env version of amplify-cli, that has a fix to the problem youy mention?
For me worked to updated all aws packages
npm i aws-sdk@latest aws-amplify@latest
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Describe the bug When upgrading AWS SDK for JS and Amplify to the latest version with
npm i aws-sdk@2.9.0
andnpm i aws-amplify@latest
, I get an error that:Module not found: Error: Can't resolve 'aws-sdk/clients/lexruntime' in '/.../node_modules/@aws-amplify/interactions/lib/Providers'
To Reproduce Steps to reproduce the behavior:
npm install --save aws-sdk@2.9.0
npm install --save aws-amplify@latest
import AWS from 'aws-sdk'
Expected behavior Upgrading aws-amplify to the latest version should require that aws-sdk be upgraded to a version containing the lex runtime.