Open acusti opened 2 years ago
Hey @acusti :wave: thanks for raising this! To better understand the context of the issue what is the motivation behind adding the custom resource to the list of workspaces in your project?
Has a solution been created for this? I'm also experiencing the same issue.
AWS Amplify Code Build Error Message:
2023-01-07T09:31:46.487Z [INFO]: info - Checking validity of types...
2023-01-07T09:31:46.689Z [INFO]: We detected TypeScript in your project and reconfigured your tsconfig.json file for you. Strict-mode is set to false by default.
2023-01-07T09:31:46.690Z [INFO]: The following mandatory changes were made to your tsconfig.json:
- isolatedModules was set to true (requirement for SWC / Babel)
2023-01-07T09:31:51.467Z [WARNING]: Failed to compile.
2023-01-07T09:31:51.468Z [WARNING]: ./amplify/backend/node_modules/@aws-amplify/graphql-transformer-interfaces/src/index.ts:2:10
Type error: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
[0m [90m 1 | [39m[36mexport[39m [33m*[39m from [32m'./transformer-context'[39m[33m;[39m[0m
[0m[31m[1m>[22m[39m[90m 2 | [39m[36mexport[39m { [33mTransformerPluginProvider[39m[33m,[39m [33mTransformerPluginType[39m } from [32m'./transformer-plugin-provider'[39m[33m;[39m[0m
[0m [90m | [39m [31m[1m^[22m[39m[0m
[0m [90m 3 | [39m[36mexport[39m {[0m
[0m [90m 4 | [39m [33mMutationFieldType[39m[33m,[39m[0m
[0m [90m 5 | [39m [33mQueryFieldType[39m[33m,[39m[0m
2023-01-07T09:31:51.495Z [ERROR]: !!! Build failed
2023-01-07T09:31:51.495Z [ERROR]: !!! Non-Zero Exit Code detected
This started when I introduced Cypress testing. Deployment was successful before.
Package.json:
"dependencies": {
"@aws-amplify/cli-extensibility-helper": "^2.3.33",
"@aws-amplify/ui-react": "^3.4.1",
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11.7.1",
"@emotion/server": "^11.4.0",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.2.4",
"@mui/material": "^5.2.4",
"@mui/x-date-pickers": "^5.0.0-alpha.2",
"aos": "^2.3.4",
"aws-amplify": "^4.3.45",
"aws-cdk-lib": "^2.49.0",
"card-validator": "^8.1.1",
"date-fns": "^2.28.0",
"dotenv": "^16.0.1",
"express-jwt": "^7.7.5",
"formik": "^2.2.6",
"jarallax": "^1.12.8",
"jwks-rsa": "^2.1.4",
"ksuid": "^3.0.0",
"next": "12.1.5",
"next-global-css": "^1.3.1",
"nextjs-progressbar": "0.0.14",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-countup": "^6.1.0",
"react-dom": "^17.0.2",
"react-image-lightbox": "^5.1.4",
"react-slick": "^0.28.1",
"react-syntax-highlighter": "^15.4.5",
"react-visibility-sensor": "^5.1.1",
"sharp": "^0.30.7",
"slick-carousel": "^1.8.1",
"yup": "^0.32.11"
},
"devDependencies": {
"@next/eslint-plugin-next": "^12.1.6",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"aws-sdk": "^2.1135.0",
"babel-eslint": "^10.1.0",
"babel-plugin-styled-components": "^2.0.2",
"cross-env": "^7.0.2",
"cypress": "^12.3.0",
"eslint": "^8.4.1",
"eslint-config-next": "^12.1.6",
"eslint-config-react-app": "^7.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"prettier": "^2.5.1",
"prettier-eslint": "^13.0.0",
"prettier-eslint-cli": "^5.0.0",
"rimraf": "^3.0.2",
"typescript": "^4.9.4"
}
I'm having the same problem with ^6.0.5
Before opening, please confirm:
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
v18.7.0
Amplify CLI Version
10.0.0
What operating system are you using?
macOS 12.1
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Amplify Categories
auth, custom, storage, function, api
Amplify Commands
push
Describe the bug
I have a custom resource that depends on
@aws-amplify/cli-extensibility-helper
. when i upgraded that dependency from2.3.26
→2.3.34
, i started getting an error when executingamplify push
(i’m using yarn workspaces, hence why the paths are prefixed with../../../../../
):i worked around the issue by adding
"isolatedModules": false
to thecompilerOptions
in my tsconfig.json for that custom resource. the issue can be resolved by using type-only imports and exports. this will make is so that files like https://github.com/aws-amplify/amplify-category-api/blob/main/packages/amplify-graphql-transformer-interfaces/src/transformer-plugin-provider.ts, which only import and export types and have no actual code exports, can still be compiled as isolated modules.Expected behavior
i expected the custom resource to build without error
Reproduction steps
@aws-amplify/cli-extensibility-helper
(v2.3.34) as dependencytsconfig.json
doesn’t overwriteisolatedModules
amplify push
GraphQL schema(s)
No response
Log output
Additional information
No response