Skip to content

Commit 475f4b5

Browse files
authored
update module troubleshooting page with vue config (#8118)
1 parent 022988a commit 475f4b5

File tree

1 file changed

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

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export function getStaticProps(context) {
2525
};
2626
}
2727

28+
<InlineFilter filters={["javascript", "react-native", "angular", "nextjs", "react"]}>
29+
2830
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.
2931

3032
To exclude the `amplify` directory in your `tsconfig.json`, add the following lines to the `exclude` section:
@@ -49,3 +51,23 @@ Alternatively, if you work within a monorepo you can move your backend to its ow
4951
}
5052
}
5153
```
54+
55+
</InlineFilter>
56+
57+
58+
<InlineFilter filters={["vue"]}>
59+
60+
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.
61+
62+
For example, if you have a `function` resource dependent on the `data` resource, you will need to include both the `resource.ts` files in your `tsconfig.app.json` file.
63+
64+
```ts title='tsconfig.app.json'
65+
{
66+
"include": [
67+
"amplify/data/resource.ts",
68+
"amplify/function/api-function/resource.ts",
69+
]
70+
}
71+
```
72+
73+
</InlineFilter>

0 commit comments

Comments
 (0)