aws-amplify / aws-amplify/amplify-hosting

Local Environment working, when pushed up to amplify Uncaught TypeError: Super expression must either be null or a function

Open
#2,952 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

d2nnfn8ylufs60

### Region

us-east-2

### Amplify Hosting feature

Not applicable

### Describe the bug

I have set up an app with CI/CD pipeline with GitHub. I used create react app and various packages. I connected a backend environment that has provisioned graphql and cognito components.

I have different branches connected to different custom domains dev/qa/prod, and have been developing and deploying successfully to the dev branch with little to no issues.

After doing some work I committed the code pushed it up which started the build in amplify.

Locally "npm start running on local host", the app runs with no errors or warnings.
When I look at the deployed app there is a blank screen with this error

![image](https://user-images.githubusercontent.com/64313480/186914111-7dee6794-ffc4-4d90-bdc3-7daa2adb27e9.png)

I've Tried So Far:

I have worked my way back commenting out components and uninstalling packages to try to nail down a particular spot where I could have introduced something. I ended up just importing App.js with

Hello
in it and it still breaks after beying deployed.

The initial error pointed to react-image-gallery (as seen in the picture I'm sharing), so I uninstalled that and got rid of the component but then the error just keeps going down the tree to another component, then another component....

The stack overflow posts about this particular error point to circular dependency issues or importing exporting things incorrectly. Why isn't this showing up locally then? I still took this advice and scoured my code to see if somewhere in my work I introduced something.

### Expected behavior

Webb App is working in the local environment, after its built and deployed it is not working.

### Reproduction steps

Travel to https://dev.jacobwazydragcourse.click/ open up console

### Build Settings

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure at the deployed dev.jacobwazydragcourse.click URL and compare it with the local npm start behavior. Inspect App.js and the browser console, then compare the deployed build with the local app to identify the deployment-specific cause; done means the deployed app loads without the TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, graphql, javascript, react
Domain
ci-cd, cloud, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.