DEV Community

hirooka kazuya
hirooka kazuya

Posted on

dev diary 20251117

AWS Amplify Gen2 deployment

i tried to production deploy test code with amplify. I have already check the developing application work in sandbox. it' OK.

in amplify gen2, the deploy of production is executed not by command prompt like the other process, but with aws console.

after opening the aws amplify in aws console, it's easy to deploy along with the guide. the local application link to amplify through github repository.

trouble shooting

i tried production deployment like above, the deployment failed because of variant type of "moduleResolution". then my countermeasure is;
the tsconfig.ts in project root folder

{
  "compilerOptions": {
    "target": "ES2017",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    //"module": "esnext",
    "module": "NodeNext", // 変更
    "moduleResolution": "NodeNext", // 変更

    // ----------------------------------------------------------
    // 💡 修正 1: .ts拡張子のインポートを許可する設定を追加
    "allowImportingTsExtensions": true,

    // 💡 修正 2: Next.js + Amplify Gen 2で推奨される設定に調整
    "moduleResolution": "NodeNext", 
    // ----------------------------------------------------------

    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "react-jsx",
Enter fullscreen mode Exit fullscreen mode

the original setting is default of next.js project. so in future at every time i build develop folder, it's necessary.

aws amplify gen2 pipe line completed !!

in this process, i completed the product pipeline. if i update the application, i change the local file and then;
git add . staging upload
git commit -m "changing description" commit to local git
git push push to remote repository

i can reflect the local change to product just with this !!

prepare to full stack app dev

i have already prepared the full stack app dev. i keep this dev folder as template for the next.
and now i have to focus on generate idea of my app.

Top comments (0)