Skip to main content

AWS Amplify

To use jupyter-react in Amplify, you need to make some changes to the build process and the Node versions.

Repository setup

After setting up your repository, follow these steps:

  1. In your repository's App Settings, navigate to the Build settings tab.
    Tab Settings
  2. Locate the App build specification section, which contains the amplify.yml file editor. This file manages the build settings.
    App build specification
  3. Click the Edit button to modify the amplify.yml file.
  4. Replace the existing content with the following code to use Yarn v3 instead of npm:
version: 1
frontend:
  phases:
    preBuild:
      commands:
        - corepack enable
        - yarn set version stable
        - yarn install
    build:
      commands:
        - yarn run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
  1. Save the changes to the amplify.yml file.
  2. Scroll down to the Edit build image settings section and click Edit.
    Build image settings
  3. By default, it uses Node version 16.0, which may not work correctly. Set the build image to node:18.17.3 (or your preferred Node version).
  4. Save the changes.

Once you've completed these steps, the next time you push to the main branch or the branch you've configured in Amplify, it will use these updated build settings. Your Amplify setup should work as expected.