Skip to content

Commit 229127d

Browse files
docs(troubleshooting): add Flutter module resolution troubleshooting guide (#8458)
1 parent 4742d13 commit 229127d

File tree

1 file changed

+4
-3
lines changed
  • src/pages/[platform]/build-a-backend/troubleshooting/cannot-find-module-amplify-env

1 file changed

+4
-3
lines changed

src/pages/[platform]/build-a-backend/troubleshooting/cannot-find-module-amplify-env/index.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { getCustomStaticPath } from '@/utils/getCustomStaticPath';
22

33
export const meta = {
44
title: 'Troubleshoot "Cannot find module $amplify/env/<function-name>"',
5-
description: 'Addressing "Cannot find module $amplify/env/<function-name>" error message',
5+
description:
6+
'Addressing "Cannot find module $amplify/env/<function-name>" error message',
67
platforms: [
78
'angular',
89
'javascript',
10+
'flutter',
911
'nextjs',
1012
'react',
1113
'react-native',
@@ -25,7 +27,7 @@ export function getStaticProps(context) {
2527
};
2628
}
2729

28-
<InlineFilter filters={["javascript", "react-native", "angular", "nextjs", "react"]}>
30+
<InlineFilter filters={["javascript", "react-native", "angular", "flutter", "nextjs", "react"]}>
2931

3032
When deploying a Amplify Gen 2 app, you may encounter the error message `Cannot find module $amplify/env/<function-name>` in your frontend build on Amplify Console. This error occurs when your framework `tsconfig.json` configuration picks up the `amplify` directory and tries to resolve it as a module. This module is a placeholder for environment variables that are injected at build time by Amplify. To resolve this error, you need to exclude the `amplify` directory.
3133

@@ -54,7 +56,6 @@ Alternatively, if you work within a monorepo you can move your backend to its ow
5456

5557
</InlineFilter>
5658

57-
5859
<InlineFilter filters={["vue"]}>
5960

6061
When deploying a Amplify Gen 2 app, you may encounter the error message `Cannot find module $amplify/env/<function-name>` in your frontend build on Amplify Console. This error occurs when your framework `tsconfig.json` configuration picks up the `amplify` directory and tries to resolve it as a module. This module is a placeholder for environment variables that are injected at build time by Amplify. To resolve this error, you will need to include the `resource.ts` files in your `tsconfig.app.json` file.

0 commit comments

Comments
 (0)