PinkyJie / aws-transcribe-demo

A simple AWS demo utilises Amazon Transcribe to convert audio to text and analyse.
45 stars 22 forks source link

Module not found: Error: Can't resolve '../stack.json' #3

Closed dariushazimi closed 4 years ago

dariushazimi commented 5 years ago

When I run the yarn build in the front end, I get an error saying

Module not found: Error: Can't resolve '../stack.json' in '/Users/darius/project/aws/aws-transcribe-demo/packages/frontend/src/components'

image

Any help would be great. Thanks.

PinkyJie commented 5 years ago

Hi @dariushazimi, stack.json is generated from the backend build script, you need to have a successful deployment for cloud formation first. If your cloudformation fails, you need to go to AWS console and manually delete the stack first before redeploy. Sometimes deleting stack won't delete all your resources(like non-empty S3), you need to do that manually.

Hope it helps.

dariushazimi commented 5 years ago

Hi @PinkyJie I am trying it again and have removed the stacks, all the S3 buckets but still the same. Have you run into this issue? Thanks

dariushazimi commented 5 years ago

@PinkyJie On a new AWS env in a new VPC I made sure there are no refrences of any deployment. But when the scripts get to creating S3, I gives an error.

Any idea?

image

PinkyJie commented 5 years ago

I think I know why, S3 bucket name must be globally unique, I guess the name S3BucketVoiceassistdevaudiofilebucket is already used by your previous task, could you go to your S3 console to check if you already has a bucket with this name?

If not, it might be used by others, I didn't consider this scenario before, one workaround is to update file packages/backend/serverless.yml:

This will create a S3 bucket with a new name, let me know if it works. At the same time, I need to think about how to fix this issue gracefully. Thanks!

dariushazimi commented 5 years ago

Thanks, @PinkyJie trying it now. Will let you know.

dariushazimi commented 5 years ago

@PinkyJie That worked fine. (need to add this to the docs). Now when I try to upload an MP3 file (size < 7 mb) I get upload failed.:

image

Any idea?

Neuronys commented 5 years ago

@PinkyJie Hello, I've managed to create the backend with the advice you gave in this thread, but I can't build the frontend as I miss the stack.json file, apparently not generated by the backend. I've tried many time, removing the stack on AWS and redo. any help from you will be highly appreciated, even the stack.json template to use. Thanks

Capture d’écran 2019-05-25 à 13 09 22
lostsheep007 commented 5 years ago

Hello @PinkyJie I am also stuck at the stack.json error when trying to build the frontend. The backend cloudformation completed successfully. Tried to use the template json that was generated renamed as stack.json but still no luck getting this working when frontend copied to s3.

PinkyJie commented 5 years ago

Hi guys @dariushazimi @Neuronys @lostsheep007 , sorry for the late response, was busy for last few months. I did a major update for this repo to replace serverless with AWS CDK, this will resolve the "stack.json" issue.

Here is a demo site: https://d3hk9i6re8qnvi.cloudfront.net/

Could you try again (either with the above dome site or with your own deployment)? Let me know if you have other issues.