aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
450 stars 113 forks source link

Upgrading to Next.js 13.4.13 results in middleware being ignored #3641

Closed terrymun closed 1 year ago

terrymun commented 1 year ago

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

Not applicable

Amplify Categories

hosting

Environment information

``` # Put output below this line System: OS: macOS 13.5 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 63.14 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.16.0 - /usr/local/bin/node Yarn: 3.6.1 - /usr/local/bin/yarn npm: 9.5.1 - /usr/local/bin/npm Browsers: Chrome: 115.0.5790.170 Edge: 115.0.1901.200 Safari: 16.6 npmPackages: %name%: 0.1.0 @ampproject/toolbox-optimizer: undefined () @apollo/client: 3.8.0 => 3.8.0 @apollo/client/cache: undefined () @apollo/client/core: undefined () @apollo/client/dev: undefined () @apollo/client/errors: undefined () @apollo/client/link/batch: undefined () @apollo/client/link/batch-http: undefined () @apollo/client/link/context: undefined () @apollo/client/link/core: undefined () @apollo/client/link/error: undefined () @apollo/client/link/http: undefined () @apollo/client/link/persisted-queries: undefined () @apollo/client/link/remove-typename: undefined () @apollo/client/link/retry: undefined () @apollo/client/link/schema: undefined () @apollo/client/link/subscriptions: undefined () @apollo/client/link/utils: undefined () @apollo/client/link/ws: undefined () @apollo/client/react: undefined () @apollo/client/react/components: undefined () @apollo/client/react/context: undefined () @apollo/client/react/hoc: undefined () @apollo/client/react/hooks: undefined () @apollo/client/react/parser: undefined () @apollo/client/react/ssr: undefined () @apollo/client/testing: undefined () @apollo/client/testing/core: undefined () @apollo/client/utilities: undefined () @apollo/client/utilities/globals: undefined () @apollo/server: 4.9.1 => 4.9.1 @apollo/server/errors: undefined () @apollo/server/express4: undefined () @apollo/server/plugin/cacheControl: undefined () @apollo/server/plugin/disabled: undefined () @apollo/server/plugin/drainHttpServer: undefined () @apollo/server/plugin/inlineTrace: undefined () @apollo/server/plugin/landingPage/default: undefined () @apollo/server/plugin/schemaReporting: undefined () @apollo/server/plugin/subscriptionCallback: undefined () @apollo/server/plugin/usageReporting: undefined () @apollo/server/standalone: undefined () @as-integrations/aws-lambda: 1.2.1 => 1.2.1 @aws-cdk/dns_validated_certificate_handler: 0.0.0 @aws-sdk/client-amplify: 3.387.0 => 3.387.0 @aws-sdk/client-dynamodb: 3.387.0 => 3.387.0 @aws-sdk/client-opensearch: 3.387.0 => 3.387.0 @aws-sdk/client-s3: 3.387.0 => 3.387.0 @aws-sdk/client-sns: 3.387.0 => 3.387.0 @aws-sdk/client-sqs: 3.387.0 => 3.387.0 @aws-sdk/client-ssm: 3.387.0 => 3.387.0 @aws-sdk/credential-provider-node: 3.387.0 => 3.387.0 @aws-sdk/lib-dynamodb: 3.387.0 => 3.387.0 @aws-sdk/types: 3.387.0 => 3.387.0 (3.357.0) @babel/core: undefined () @babel/runtime: 7.15.4 @commitlint/cli: 17.6.7 => 17.6.7 @commitlint/config-conventional: 17.6.7 => 17.6.7 @commitlint/config-nx-scopes: 17.6.4 => 17.6.4 @cypress/angular: 0.0.0-development @cypress/mount-utils: 0.0.0-development @cypress/react: 0.0.0-development @cypress/react18: 0.0.0-development @cypress/svelte: 0.0.0-development @cypress/vue: 0.0.0-development @cypress/vue2: 0.0.0-development @databricks/sql: 1.3.0 => 1.3.0 @edge-runtime/cookies: 3.2.1 @edge-runtime/ponyfill: 2.3.0 @edge-runtime/primitives: 3.0.1 @graphql-codegen/cli: 4.0.1 => 4.0.1 @graphql-codegen/client-preset: 4.1.0 => 4.1.0 @graphql-codegen/introspection: 4.0.0 => 4.0.0 @hapi/accept: undefined () @lego/playbook-icons: 0.24.0 => 0.24.0 @lego/video-player-common: 0.23.0 => 0.23.0 @lego/video-player-react: 0.31.1 => 0.31.1 @lhci/cli: 0.12.0 => 0.12.0 @napi-rs/triples: undefined () @next/bundle-analyzer: 13.4.13 => 13.4.13 @next/font: undefined () @next/react-dev-overlay: undefined () @nx/cypress: 16.6.0 => 16.6.0 @nx/devkit: 16.6.0 => 16.6.0 @nx/esbuild: 16.6.0 => 16.6.0 @nx/eslint-plugin: 16.6.0 => 16.6.0 @nx/jest: 16.6.0 => 16.6.0 @nx/js: 16.6.0 => 16.6.0 @nx/linter: 16.6.0 => 16.6.0 @nx/next: 16.6.0 => 16.6.0 @nx/node: 16.6.0 => 16.6.0 @nx/plugin: 16.6.0 => 16.6.0 @nx/react: 16.6.0 => 16.6.0 @nx/storybook: 16.6.0 => 16.6.0 @nx/web: 16.6.0 => 16.6.0 @nx/workspace: 16.6.0 => 16.6.0 @opensearch-project/opensearch: 2.3.1 => 2.3.1 @opentelemetry/api: undefined () @pellegrims/nx-remotecache-s3: 3.0.0 => 3.0.0 @playwright/test: 1.36.2 => 1.36.2 @radix-ui/react-aspect-ratio: 1.0.3 => 1.0.3 @radix-ui/react-dialog: 1.0.4 => 1.0.4 @radix-ui/react-dropdown-menu: 2.0.5 => 2.0.5 @radix-ui/react-hover-card: 1.0.6 => 1.0.6 @radix-ui/react-tabs: 1.0.4 => 1.0.4 @radix-ui/react-visually-hidden: 1.0.3 => 1.0.3 @react-hookz/web: 23.1.0 => 23.1.0 @react-spring/web: 9.7.3 => 9.7.3 @segment/ajv-human-errors: undefined () @snowplow/browser-plugin-client-hints: 3.13.1 => 3.13.1 @snowplow/browser-tracker: 3.13.1 => 3.13.1 @storybook/addon-a11y: 7.2.1 => 7.2.1 @storybook/addon-essentials: 7.2.1 => 7.2.1 @storybook/addon-interactions: 7.2.1 => 7.2.1 @storybook/addon-mdx-gfm: 7.2.1 => 7.2.1 @storybook/blocks: 7.2.1 => 7.2.1 @storybook/core-server: 7.2.1 => 7.2.1 @storybook/jest: 0.1.0 => 0.1.0 @storybook/nextjs: 7.2.1 => 7.2.1 @storybook/react: 7.2.1 => 7.2.1 @storybook/testing-library: 0.2.0 => 0.2.0 @svgr/core: 8.0.0 => 8.0.0 @svgr/plugin-jsx: 8.0.1 => 8.0.1 @swc-node/register: 1.6.6 => 1.6.6 @swc/cli: 0.1.62 => 0.1.62 @swc/core: 1.3.75 => 1.3.75 @swc/helpers: 0.5.1 => 0.5.1 @swc/jest: 0.2.28 => 0.2.28 @testing-library/jest-dom: 5.17.0 => 5.17.0 @testing-library/react: 14.0.0 => 14.0.0 @testing-library/user-event: 14.4.3 => 14.4.3 @tokens-studio/sd-transforms: 0.9.1 => 0.9.1 @types/aws-lambda: 8.10.119 => 8.10.119 @types/aws4: 1.11.3 => 1.11.3 @types/decompress: 4.2.4 => 4.2.4 @types/inquirer: 8.2.6 => 8.2.6 @types/is-ci: 3.0.0 => 3.0.0 @types/jest: 29.5.3 => 29.5.3 @types/lodash.camelcase: 4.3.7 => 4.3.7 @types/lodash.debounce: 4.0.7 => 4.0.7 @types/lodash.kebabcase: 4.1.7 => 4.1.7 @types/lodash.startcase: 4.4.7 => 4.4.7 @types/node: 18.17.3 => 18.17.3 (16.18.39, 18.7.23) @types/react: 18.2.19 => 18.2.19 @types/react-dom: 18.2.7 => 18.2.7 @types/react-test-renderer: 18.0.0 => 18.0.0 @types/react-transition-group: 4.4.6 => 4.4.6 @types/tinycolor2: 1.4.3 => 1.4.3 @typescript-eslint/eslint-plugin: 6.3.0 => 6.3.0 @typescript-eslint/parser: 6.3.0 => 6.3.0 (5.62.0) @use-gesture/react: 10.2.27 => 10.2.27 @vercel/nft: undefined () @vercel/og: undefined () @vscode/vsce: 2.20.1 => 2.20.1 acorn: undefined () amphtml-validator: undefined () anser: undefined () apollo-link-rest: 0.9.0 => 0.9.0 arg: undefined () assert: undefined () async-retry: undefined () async-sema: undefined () aws-cdk: 2.90.0 => 2.90.0 aws-cdk-lib: 2.90.0 => 2.90.0 babel-jest: 29.6.2 => 29.6.2 babel-packages: undefined () babel-plugin-dynamic-import-node: 2.3.3 => 2.3.3 browserify-zlib: undefined () browserslist: undefined () buffer: undefined () bytes: undefined () chalk: 4.1.2 => undefined (2.4.2, 3.0.0, 4.1.2, 1.1.3, , 2.3.0) chromatic: 6.21.0 => 6.21.0 ci-info: undefined () class-validator: 0.14.0 => 0.14.0 cli-select: undefined () client-only: 0.0.1 clsx: 2.0.0 => 2.0.0 (1.2.1) codeowners: 5.1.1 => 5.1.1 comment-json: undefined () compression: undefined () conf: undefined () constants-browserify: undefined () constructs: 10.2.69 => 10.2.69 content-disposition: undefined () content-type: undefined () cookie: undefined () core-js: 3.32.0 => 3.32.0 cross-env: 7.0.3 => 7.0.3 cross-fetch: 4.0.0 => 4.0.0 (3.1.8, 3.1.5) cross-fetch-polyfill: 0.0.0 cross-spawn: undefined () crypto-browserify: undefined () css-loader: 6.8.1 => 6.8.1 css.escape: undefined () custom-file-header: 1.0.0 cypress: 12.17.3 => 12.17.3 danger: 11.2.8 => 11.2.8 data-uri-to-buffer: undefined () debug: undefined () decompress: 4.2.1 => 4.2.1 deepmerge: 4.3.1 => 4.3.1 devalue: undefined () domain-browser: undefined () dts-css-modules-loader: 2.0.1 => 2.0.1 edge-runtime: undefined () eslint: 8.46.0 => 8.46.0 eslint-config-next: 13.4.8 => 13.4.8 eslint-config-prettier: 9.0.0 => 9.0.0 eslint-import-resolver-typescript: 3.5.5 => 3.5.5 eslint-plugin-cdk: 1.8.0 => 1.8.0 eslint-plugin-cypress: 2.14.0 => 2.14.0 eslint-plugin-import: 2.28.0 => 2.28.0 eslint-plugin-jest: 27.2.3 => 27.2.3 eslint-plugin-jsx-a11y: 6.7.1 => 6.7.1 eslint-plugin-mdx: 2.1.0 => 2.1.0 eslint-plugin-playwright: 0.15.3 => 0.15.3 eslint-plugin-prefer-arrow-functions: 3.1.4 => 3.1.4 eslint-plugin-react: 7.33.1 => 7.33.1 eslint-plugin-react-hooks: 4.6.0 => 4.6.0 eslint-plugin-react-prefer-function-component: 3.2.0 => 3.2.0 eslint-plugin-sort-exports: 0.8.0 => 0.8.0 eslint-plugin-storybook: 0.6.13 => 0.6.13 eslint-plugin-testing-library: 5.11.1 => 5.11.1 eslint-plugin-unicorn: 48.0.1 => 48.0.1 events: undefined () find-cache-dir: undefined () find-up: undefined () font-face-rules: 1.0.0 format-helpers: 1.0.0 fresh: undefined () get-orientation: undefined () glob: 10.3.3 => undefined (7.2.3, 7.1.7, 8.1.0, 10.3.3, 7.1.2, , 7.1.4) graphql: 16.7.1 => 16.7.1 gsap: 3.12.2 => 3.12.2 gzip-size: undefined () http-proxy: undefined () http-proxy-agent: undefined () https-browserify: undefined () https-proxy-agent: undefined () husky: 8.0.3 => 8.0.3 icss-utils: undefined () ignore-loader: undefined () image-size: undefined () inquirer: 8.2.6 => 8.2.6 (8.2.5, 6.5.2) is-animated: undefined () is-ci: 3.0.1 => 3.0.1 is-docker: undefined () is-wsl: undefined () jest: 29.6.2 => 29.6.2 jest-docblock: undefined () jest-environment-jsdom: 29.6.2 => 29.6.2 jest-next-dynamic: 1.0.1 => 1.0.1 jest-worker: undefined () json-schema-to-typescript: 13.0.2 => 13.0.2 json5: undefined () jsonc-eslint-parser: 2.3.0 => 2.3.0 jsonwebtoken: undefined () loader-runner: undefined () loader-utils: undefined () lodash.camelcase: 4.3.0 => 4.3.0 lodash.curry: undefined () lodash.kebabcase: 4.1.1 => 4.1.1 lodash.startcase: 4.4.0 => 4.4.0 lru-cache: undefined () micromatch: undefined () mini-css-extract-plugin: undefined () nanoid: undefined () native-url: undefined () neo-async: undefined () next: 13.4.13 => 13.4.13 next-purge-css-modules: 1.1.0 => 1.1.0 nextra: 2.10.0 => 2.10.0 nextra-theme-docs: 2.10.0 => 2.10.0 node-fetch: undefined () node-html-parser: undefined () normalize.css: 8.0.1 => 8.0.1 npm-run-all: 4.1.5 => 4.1.5 nx: 16.6.0 => 16.6.0 nx-stylelint: 15.0.0 => 15.0.0 oidc-client-ts: 2.2.4 => 2.2.4 ora: undefined () os-browserify: undefined () p-limit: undefined () path-browserify: undefined () platform: undefined () postcss-flexbugs-fixes: undefined () postcss-modules-extract-imports: undefined () postcss-modules-local-by-default: undefined () postcss-modules-scope: undefined () postcss-modules-values: undefined () postcss-preset-env: undefined () postcss-safe-parser: undefined () postcss-scss: 4.0.6 => 4.0.6 () postcss-value-parser: undefined () prettier: 2.8.8 => 2.8.8 process: undefined () punycode: undefined () querystring-es3: undefined () raw-body: undefined () react: 18.2.0 => 18.2.0 react-builtin: undefined () react-dom: 18.2.0 => 18.2.0 react-dom-builtin: undefined () react-dom-experimental-builtin: undefined () react-experimental-builtin: undefined () react-is: 18.2.0 react-oidc-context: 2.2.2 => 2.2.2 react-refresh: 0.12.0 react-server-dom-webpack-builtin: undefined () react-server-dom-webpack-experimental-builtin: undefined () react-transition-group: 4.4.5 => 4.4.5 react-transition-group/CSSTransition: undefined () react-transition-group/ReplaceTransition: undefined () react-transition-group/SwitchTransition: undefined () react-transition-group/Transition: undefined () react-transition-group/TransitionGroup: undefined () react-transition-group/TransitionGroupContext: undefined () react-transition-group/config: undefined () react-unity-webgl: 9.4.3 => 9.4.3 react-useportal: 1.0.18 => 1.0.18 reflect-metadata: 0.1.13 => 0.1.13 regenerator-runtime: 0.14.0 => 0.14.0 (0.13.11, 0.13.4) remark-gfm: 3.0.1 => 3.0.1 renamer: 4.0.0 => 4.0.0 rimraf: 5.0.1 => 5.0.1 (3.0.2, 2.7.1) sass: 1.64.2 => 1.64.2 sass-loader: 13.3.2 => 13.3.2 (12.6.0, ) scheduler-builtin: undefined () scheduler-experimental-builtin: undefined () schema-utils: undefined () semver: undefined () send: undefined () server-only: 0.0.1 => 0.0.1 setimmediate: undefined () sharp: 0.32.4 => 0.32.4 shell-quote: undefined () source-map: undefined () source-map-support: 0.5.21 => 0.5.21 (0.5.19, 0.5.13) stacktrace-parser: undefined () storybook-addon-swc: 1.2.0 => 1.2.0 stream-browserify: undefined () stream-http: undefined () string-hash: undefined () string_decoder: undefined () strip-ansi: undefined () style-dictionary: 3.8.0 => 3.8.0 style-dictionary-assets-base64-embed: 1.0.0 style-dictionary-auto-rebuild-watcher: 1.0.0 style-dictionary-component-cti: 1.0.0 style-dictionary-create-react-app: 1.0.0 style-dictionary-custom-formats-with-templates: 1.0.0 style-dictionary-custom-transforms: 1.0.0 style-dictionary-example-complete: 1.0.0 style-dictionary-example-custom-parser: 1.0.0 style-dictionary-example-node: 1.0.0 style-dictionary-example-variables-in-outputs: 1.0.0 style-dictionary-example-yaml-tokens: 1.0.0 style-dictionary-filters: 1.0.0 style-dictionary-matching-build-files: 1.0.0 style-dictionary-npm-example: 1.0.0 style-dictionary-referencing_aliasing: 1.0.0 style-dictionary-s3-example: 1.0.0 style-dictionary-tokens-deprecation: 1.0.0 style-loader: 3.3.3 => 3.3.3 stylelint: 15.10.2 => 15.10.2 stylelint-config-idiomatic-order: 9.0.0 => 9.0.0 stylelint-config-standard: 34.0.0 => 34.0.0 (33.0.0) stylelint-config-standard-scss: 10.0.0 => 10.0.0 stylelint-csstree-validator: 3.0.0 => 3.0.0 stylelint-high-performance-animation: 1.9.0 => 1.9.0 stylelint-order: 6.0.3 => 6.0.3 (5.0.0) stylelint-scss: 5.1.0 => 5.1.0 tar: undefined () terser: undefined () text-table: undefined () timers-browserify: undefined () tinycolor: 0.0.1 => 0.0.1 tinycolor2: 1.6.0 => 1.6.0 transitive-transforms: 1.0.0 ts-jest: 29.1.1 => 29.1.1 ts-node: 10.9.1 => 10.9.1 tsconfig-paths: 4.2.0 => 4.2.0 (3.14.2) tslib: 2.6.1 => 2.6.1 (1.14.1, 2.5.0) tty-browserify: undefined () type-graphql: 2.0.0-beta.2 => 2.0.0-beta.2 typed-scss-modules: 7.1.4 => 7.1.4 typescript: 5.1.6 => 5.1.6 ua-parser-js: undefined () undici: undefined () unistore: undefined () url-loader: 4.1.1 => 4.1.1 util: undefined () vm-browserify: undefined () vscode: 1.1.37 => 1.1.37 watchpack: undefined () web-vitals: undefined () webpack: undefined () webpack-sources: undefined () ws: undefined () zlib: 1.0.5 => 1.0.5 zod: 3.21.4 => 3.21.4 () zod-validation-error: 1.3.1 => 1.3.1 npmGlobalPackages: @nrwl/cli: 15.8.6 corepack: 0.17.0 generator-code: 1.7.5 npm: 9.5.1 yarn: 1.22.19 yo: 4.3.1 ```

Describe the bug

We have a typical Next.js site middleware config that ensures requests to paths starting with _next are ignored, so that we can use the image optimizer provided. It also performs a redirect to a localized URL if no locale is detected.

The issue:

All these suggest that the middleware is not being used at all, as the redirection behavior is expected based on the middleware config.

🐛 This bug is only reproducible in next@13.4.13 and above (including the latest canary 13.4.14-canary.1. When downgrading the dependency to 13.4.12 the issue goes away and all redirects work as expected.

Expected behavior

The middleware routing should work as expected, e.g.:

Reproduction steps

  1. Start a Next.js project
  2. Configure it to output: 'standalone'
  3. Configure middleware with the code snippet below
  4. Add a basic static image component, e.g. <Image src={staticImageImport} alt="" /> so that you will force Next.js to use the image optimizer to load the image
  5. Let AWS deploy a preview branch
  6. Notice that the AWS preview will fail to use the image optimizer

Code Snippet

A boiled down version of our middleware config:

const PUBLIC_FILE = /\.(.*)$/;
const LOCALE_REGEX = '\\/\\w{2}-\\w{2}';

export const middleware = (req: NextRequest) => {
  const { pathname, search } = req.nextUrl;

  console.log(`Middleware: ${pathname}`);

  if (pathname.startsWith('/_next') || pathname.includes('/api/') || PUBLIC_FILE.test(pathname)) {
    console.log(`${pathname} is internal and will not be redirected`);
    return NextResponse.next();
  }

  // Basic logic that performs i18n locale redirection
  // For simplicity's sake, let's say we always redirect to "en-us"
  if (!pathname.match(new RegExp(`^${LOCALE_REGEX}`))) {
    return NextResponse.redirect(new URL(`/en-us/${pathname}${search}`, req.url));
  }

  // Catch-all
  return NextResponse.next();
}

Log output

No response

aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

cwomack commented 1 year ago

Hello, @terrymun 👋 and thanks for opening this issue. This actually looking like an issue that would be more related to the Amplify Hosting side. I'll transfer your issue over to that repo for better assistance.

terrymun commented 1 year ago

Thanks a lot for your help @cwomack 👍

SamKomesarook commented 1 year ago

Can confirm our project is suffering from the same issue: image routing is not working as expected.

doiali commented 1 year ago

I have suddenly a similar issue in nextjs 13.4.12 without any change to the code base.
I tried redeploying a previous build that was working fine during the last 5 days, But now it doesn't work properly and everything's broken.
Here's the deployed preview: https://pr-14.d1uhtp6enph3is.amplifyapp.com/

DarkPhoenix2704 commented 1 year ago

Problem Solved [Updated to 13.4.13]

Facing similar issue in Next 13.4.8. Can I know when will it be fixed?

terrymun commented 1 year ago

Still seeing the same issue in next@13.4.16: the Middleware redirects are still being ignored.

Tomekmularczyk commented 1 year ago

We are using next-intl which sets up a middleware. When deploying the app to Vercel it works, when deploying to Amplify hosting - 404 pages. I experienced that with Nextjs version 13.4.13 and now with 13.4.16. This block us from updating the Nextjs containing important fixes.

terrymun commented 1 year ago

We are using next-intl which sets up a middleware. When deploying the app to Vercel it works, when deploying to Amplify hosting - 404 pages. I experienced that with Nextjs version 13.4.13 and now with 13.4.16. This block us from updating the Nextjs containing important fixes.

The last known version of Nextjs that works with Amplify is 13.4.12, that’s our experience as well.

calavera commented 1 year ago

It looks like this change in Next.js is the problem: https://github.com/vercel/next.js/pull/52492/files

We're working in a fix to be able to support newer versions.

terrymun commented 1 year ago

It looks like this change in Next.js is the problem: https://github.com/vercel/next.js/pull/52492/files

We're working in a fix to be able to support newer versions.

@calavera Thanks for the insights! Out of curiosity, when you say “we”, are you referring to the team behind Amplify hosting or Vercel?

calavera commented 1 year ago

@calavera Thanks for the insights! Out of curiosity, when you say “we”, are you referring to the team behind Amplify hosting or Vercel?

Amplify Hosting

ferdingler commented 1 year ago

Cross-posting the issue on Next.js side: https://github.com/vercel/next.js/issues/53872

ethyaan commented 1 year ago

Hey All, is there any update on this? Is this something that gonna be fixed soon or we might have to wait?

terrymun commented 1 year ago

This is still an issue on next@13.4.19

ethyaan commented 1 year ago

i've downgraded my next v to v.13.4.11 and it works, This is the workaround for now until our friends in AWS fix this.

ethyaan commented 1 year ago

and It happens to be like if you are using headlessui, you must also downgrade that because of this issue https://github.com/tailwindlabs/headlessui/issues/2606#issuecomment-1647907596

nii3601 commented 1 year ago

The issue still occurs with next@13.4.19 on AWS Amplify

ethyaan commented 1 year ago

@nii3601 nobody given anyupdate yet, so we expect this to be happening yet.

nii3601 commented 1 year ago

Thanks @ethyaan , apologies if that came off the wrong way. I was commenting so that I could follow along with this thread. Wish your team all the best in solving this issue.

andre-mr commented 1 year ago

We're working in a fix to be able to support newer versions.

What is the latest Next version that Amplify supports today? 13.3.4? 13.4.11? Is there a place where we can keep track of this always-updated information, in addition to jumping between issues?

ethyaan commented 1 year ago

@andre-mr https://github.com/aws-amplify/amplify-hosting/issues/3641#issuecomment-1687808066

terrymun commented 1 year ago

@andre-mr The last Next.js version that works with AWS Amplify is 13.4.12

andre-mr commented 1 year ago

13.4.11 for @ethyaan and 13.4.12 for @terrymun

i have some cloudfront cache issues here using 13.3.4 and 13.2.4. i'll try to update to see if it makes any difference. but i'll try not to update to something higher than these you mentionend for now, thanks.

TheGreenInsurer-MT commented 1 year ago

@Jay2113 Is there an ETA on a fix for this issue as yet please or is it still under investigation?

My middleware is working in 13.4.12 but nothing newer.

rafin-whitehat commented 1 year ago

Got stuck even in v13.4.12.

Mexflubber commented 1 year ago

@rafin-whitehat that's weird, maybe it's due to something else. Like others mine is working with 13.4.12.

rafin-whitehat commented 1 year ago

I forgot to add unoptimized:true and I think that worked.

ethyaan commented 1 year ago

It's Funny, people here discussing anything except the fact that AWS Amplify not keeping up with latest releases. 1 Month passed and they know the issue, but still nothing happened. I'm gonna escalate this from our partnership panel with AWS. we paying so much money for using outdated versions. it's ridiculous. if you can't keep up, we move all our services on other providers.

victorccccc commented 1 year ago

Hi folks 👋 , sorry for the inconvenience. We are currently deploying the fix through the system, the ECD for this deployment is Wed 09/13. thanks for your patience again.

terrymun commented 1 year ago

@victorccccc Thanks for giving us an update and an ETA for the fix. Is it possible to shed light on what actually broke behind the scenes? Asking from a place of curiosity.

victorccccc commented 1 year ago

Deployment complete in all regions, please build your app again to receive the update.

Is it possible to shed light on what actually broke behind the scenes? Asking from a place of curiosity.

It's caused by a breaking change: https://github.com/vercel/next.js/pull/52492 brought by the next.js on a patch release (13.4.12->13.4.13). This change separates routing code from render servers so that next-server only handles the “render” work and the “router" work is handled by router server now. We are missing "router" part in next server after this release so things broke.

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] commented 1 year ago

This issue has been automatically locked.