Global and Process Shim
Angular does not include shims for global or process. Follow the instructions below to resolve global or process reference errors.
First, create src/polyfills.ts and add the following:
(window as any).global = window;
(window as any).process = {
env: { DEBUG: undefined },
};
Then, open your angular.json file, and add src/polyfills.ts to polyfills array(s) in your angular.json. These arrays are located in projects.<project-name>.architect.<task-name>.options.
"polyfills": [
"zone.js",
"src/polyfills.ts"
],
And finally, make sure to add src/polyfills to files in your tsconfig:
{
"files": [
"src/main.ts",
"src/polyfills.ts"
],
}
Add the following to your src/polyfills.ts:
(window as any).global = window;
(window as any).process = {
env: { DEBUG: undefined },
};
Could not find a declaration file for module './aws-exports'
If you run into TypeScript errors importing aws-exports.js, create aws-exports.d.ts file in the directory aws-exports.js is in and add the following content:
declare const awsmobile: Record<string, any>
export default awsmobile;
Server-side Rendering (SSR)
Amplify UI components are interactive and designed to work with Client-side Rendering (CSR). You must ensure that Amplify UI components are not rendered on the server in SSR-enabled projects.
Problems with OnPush change detection
The Authenticator component currently does not support use of the OnPush change detection strategy. Please use the Default strategy instead.
Warning: CommonJS or AMD dependencies
If you see CommonJS or AMD dependencies optimization bailouts warnings, add the following content to your angular.json.