Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextjs 13.4.3 ssr Error: ENOENT: no such file or directory, lstat '/codebuild/output/src554686390/src/hkv_3_nextjs/.next/server/app'] #11404

Closed
3 tasks done
dgastudio opened this issue May 24, 2023 · 7 comments
Assignees
Labels

Comments

@dgastudio
Copy link

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

Not applicable

Amplify Categories

Not applicable

Environment information

# Put output below this line

  System:
    OS: macOS 13.3.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 94.56 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 19.7.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.6 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 113.0.5672.126
    Firefox: 112.0.1
    Safari: 16.4
  npmPackages:
    @ampproject/toolbox-optimizer:  undefined ()
    @babel/core:  undefined ()
    @babel/runtime:  7.15.4 
    @edge-runtime/cookies:  3.0.6 
    @edge-runtime/primitives:  2.1.2 
    @hapi/accept:  undefined ()
    @napi-rs/triples:  undefined ()
    @next/font:  undefined ()
    @next/react-dev-overlay:  undefined ()
    @opentelemetry/api:  undefined ()
    @rsuite/charts: ^5.2.0 => 5.2.0 
    @segment/ajv-human-errors:  undefined ()
    @stripe/stripe-js: ^1.53.0 => 1.53.0 
    @vercel/nft:  undefined ()
    @vercel/og:  undefined ()
    acorn:  undefined ()
    amphtml-validator:  undefined ()
    anser:  undefined ()
    arg:  undefined ()
    assert:  undefined ()
    async-retry:  undefined ()
    async-sema:  undefined ()
    axios: ^1.4.0 => 1.4.0 
    axios-auth-refresh: ^3.3.6 => 3.3.6 
    babel-packages:  undefined ()
    browserify-zlib:  undefined ()
    browserslist:  undefined ()
    buffer:  undefined ()
    bytes:  undefined ()
    centrifuge: ^3.1.2 => 3.1.2 
    chalk:  undefined ()
    ci-info:  undefined ()
    cli-select:  undefined ()
    client-only:  0.0.1 
    comment-json:  undefined ()
    compression:  undefined ()
    conf:  undefined ()
    constants-browserify:  undefined ()
    content-disposition:  undefined ()
    content-type:  undefined ()
    cookie: ^0.5.0 => undefined (0.5.0, 0.4.2, )
    cookies-next: ^2.1.1 => 2.1.1 
    cross-spawn:  undefined ()
    crypto-browserify:  undefined ()
    css.escape:  undefined ()
    data-uri-to-buffer:  undefined ()
    dayjs: ^1.11.7 => 1.11.7 
    debug:  undefined ()
    devalue:  undefined ()
    domain-browser:  undefined ()
    echarts: ^5.4.2 => 5.4.2 
    edge-runtime:  undefined ()
    emoji-mart: ^5.5.2 => 5.5.2 
    eslint: 8.41.0 => 8.41.0 
    eslint-config-next: 13.4.3 => 13.4.3 
    events:  undefined ()
    fast-sort: ^3.4.0 => 3.4.0 
    find-cache-dir:  undefined ()
    find-up:  undefined ()
    fresh:  undefined ()
    get-orientation:  undefined ()
    glob:  undefined ()
    group-items: ^2.2.1 => 2.2.1 
    gzip-size:  undefined ()
    howler: ^2.2.3 => 2.2.3 
    http-proxy:  undefined ()
    http-proxy-agent:  undefined ()
    https-browserify:  undefined ()
    https-proxy-agent:  undefined ()
    icss-utils:  undefined ()
    ignore-loader:  undefined ()
    image-size:  undefined ()
    is-animated:  undefined ()
    is-docker:  undefined ()
    is-wsl:  undefined ()
    itemsjs: ^2.1.21 => 2.1.21 
    jest-worker:  undefined ()
    json5:  undefined ()
    jsonwebtoken:  undefined ()
    lightgallery: ^2.7.1 => 2.7.1 
    lightgallery/angular:  0.0.1 
    lightgallery/angular/10:  0.0.1 
    lightgallery/angular/11:  0.0.1 
    lightgallery/angular/12:  0.0.1 
    lightgallery/angular/13:  0.0.1 
    lightgallery/angular/9:  0.0.1 
    lightgallery/lit:  undefined ()
    lightgallery/plugins/autoplay:  undefined ()
    lightgallery/plugins/comment:  undefined ()
    lightgallery/plugins/fullscreen:  undefined ()
    lightgallery/plugins/hash:  undefined ()
    lightgallery/plugins/mediumZoom:  undefined ()
    lightgallery/plugins/pager:  undefined ()
    lightgallery/plugins/relativeCaption:  undefined ()
    lightgallery/plugins/rotate:  undefined ()
    lightgallery/plugins/share:  undefined ()
    lightgallery/plugins/thumbnail:  undefined ()
    lightgallery/plugins/video:  undefined ()
    lightgallery/plugins/vimeoThumbnail:  undefined ()
    lightgallery/plugins/zoom:  undefined ()
    lightgallery/react:  undefined ()
    lightgallery/vue:  undefined ()
    loader-runner:  undefined ()
    loader-utils:  undefined ()
    lodash: ^4.17.21 => 4.17.21 
    lodash.curry:  undefined ()
    lru-cache:  undefined ()
    micromatch:  undefined ()
    mini-css-extract-plugin:  undefined ()
    nanoid:  undefined ()
    native-url:  undefined ()
    neo-async:  undefined ()
    next: 13.4.3 => 13.4.3 
    next-auth: ^4.22.1 => 4.22.1 
    node-fetch:  undefined ()
    node-html-parser:  undefined ()
    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:  undefined ()
    postcss-value-parser:  undefined ()
    process:  undefined ()
    punycode:  undefined ()
    query-string: ^8.1.0 => 8.1.0 
    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-hook-speech-to-text: ^0.8.0 => 0.8.0 
    react-is:  18.2.0 
    react-is-visible: ^1.2.0 => 1.2.0 
    react-refresh:  0.12.0 
    react-scroll-sync: ^0.11.0 => 0.11.0 
    react-server-dom-webpack-builtin:  undefined ()
    react-server-dom-webpack-experimental-builtin:  undefined ()
    react-toastify: ^9.1.3 => 9.1.3 
    react-use-precision-timer: ^3.3.1 => 3.3.1 
    regenerator-runtime:  0.13.4 
    rrule: ^2.7.2 => 2.7.2 
    rsuite: ^5.34.0 => 5.34.0 
    rsuite-color-picker: ^0.2.0 => 0.2.0 
    rsuite/Affix:  undefined ()
    rsuite/Animation:  undefined ()
    rsuite/AutoComplete:  undefined ()
    rsuite/Avatar:  undefined ()
    rsuite/AvatarGroup:  undefined ()
    rsuite/Badge:  undefined ()
    rsuite/Breadcrumb:  undefined ()
    rsuite/Button:  undefined ()
    rsuite/ButtonGroup:  undefined ()
    rsuite/ButtonToolbar:  undefined ()
    rsuite/Calendar:  undefined ()
    rsuite/Carousel:  undefined ()
    rsuite/Cascader:  undefined ()
    rsuite/CheckPicker:  undefined ()
    rsuite/CheckTree:  undefined ()
    rsuite/CheckTreePicker:  undefined ()
    rsuite/Checkbox:  undefined ()
    rsuite/CheckboxGroup:  undefined ()
    rsuite/CloseButton:  undefined ()
    rsuite/Col:  undefined ()
    rsuite/Container:  undefined ()
    rsuite/Content:  undefined ()
    rsuite/CustomProvider:  undefined ()
    rsuite/DOMHelper:  undefined ()
    rsuite/DatePicker:  undefined ()
    rsuite/DateRangePicker:  undefined ()
    rsuite/Disclosure:  undefined ()
    rsuite/Divider:  undefined ()
    rsuite/Drawer:  undefined ()
    rsuite/Dropdown:  undefined ()
    rsuite/FlexboxGrid:  undefined ()
    rsuite/Footer:  undefined ()
    rsuite/Form:  undefined ()
    rsuite/FormControl:  undefined ()
    rsuite/FormControlLabel:  undefined ()
    rsuite/FormErrorMessage:  undefined ()
    rsuite/FormGroup:  undefined ()
    rsuite/FormHelpText:  undefined ()
    rsuite/Grid:  undefined ()
    rsuite/Header:  undefined ()
    rsuite/IconButton:  undefined ()
    rsuite/Input:  undefined ()
    rsuite/InputGroup:  undefined ()
    rsuite/InputNumber:  undefined ()
    rsuite/InputPicker:  undefined ()
    rsuite/List:  undefined ()
    rsuite/Loader:  undefined ()
    rsuite/MaskedInput:  undefined ()
    rsuite/Menu:  undefined ()
    rsuite/Message:  undefined ()
    rsuite/Modal:  undefined ()
    rsuite/MultiCascader:  undefined ()
    rsuite/Nav:  undefined ()
    rsuite/Navbar:  undefined ()
    rsuite/Notification:  undefined ()
    rsuite/Overlay:  undefined ()
    rsuite/Pagination:  undefined ()
    rsuite/Panel:  undefined ()
    rsuite/PanelGroup:  undefined ()
    rsuite/Picker:  undefined ()
    rsuite/Placeholder:  undefined ()
    rsuite/Plaintext:  undefined ()
    rsuite/Popover:  undefined ()
    rsuite/Progress:  undefined ()
    rsuite/Radio:  undefined ()
    rsuite/RadioGroup:  undefined ()
    rsuite/RangeSlider:  undefined ()
    rsuite/Rate:  undefined ()
    rsuite/Ripple:  undefined ()
    rsuite/Row:  undefined ()
    rsuite/SafeAnchor:  undefined ()
    rsuite/Schema:  undefined ()
    rsuite/SelectPicker:  undefined ()
    rsuite/Sidebar:  undefined ()
    rsuite/Sidenav:  undefined ()
    rsuite/Slider:  undefined ()
    rsuite/Stack:  undefined ()
    rsuite/Steps:  undefined ()
    rsuite/Table:  undefined ()
    rsuite/Tag:  undefined ()
    rsuite/TagGroup:  undefined ()
    rsuite/TagInput:  undefined ()
    rsuite/TagPicker:  undefined ()
    rsuite/Timeline:  undefined ()
    rsuite/Toggle:  undefined ()
    rsuite/Tooltip:  undefined ()
    rsuite/Tree:  undefined ()
    rsuite/TreePicker:  undefined ()
    rsuite/Uploader:  undefined ()
    rsuite/Whisper:  undefined ()
    rsuite/Windowing:  undefined ()
    rsuite/locales:  undefined ()
    rsuite/locales/ar_EG:  undefined ()
    rsuite/locales/da_DK:  undefined ()
    rsuite/locales/de_DE:  undefined ()
    rsuite/locales/default:  undefined ()
    rsuite/locales/en_GB:  undefined ()
    rsuite/locales/en_US:  undefined ()
    rsuite/locales/es_AR:  undefined ()
    rsuite/locales/es_ES:  undefined ()
    rsuite/locales/fa_IR:  undefined ()
    rsuite/locales/fi_FI:  undefined ()
    rsuite/locales/fr_FR:  undefined ()
    rsuite/locales/hu_HU:  undefined ()
    rsuite/locales/it_IT:  undefined ()
    rsuite/locales/kk_KZ:  undefined ()
    rsuite/locales/ko_KR:  undefined ()
    rsuite/locales/nl_NL:  undefined ()
    rsuite/locales/pt_BR:  undefined ()
    rsuite/locales/ru_RU:  undefined ()
    rsuite/locales/sv_SE:  undefined ()
    rsuite/locales/tr_TR:  undefined ()
    rsuite/locales/zh_CN:  undefined ()
    rsuite/locales/zh_TW:  undefined ()
    rsuite/toaster:  undefined ()
    rsuite/utils:  undefined ()
    sass: ^1.62.1 => 1.62.1 
    sass-loader:  undefined ()
    scheduler-builtin:  undefined ()
    scheduler-experimental-builtin:  undefined ()
    schema-utils:  undefined ()
    screenfull: ^6.0.2 => 6.0.2 
    semver:  undefined ()
    send:  undefined ()
    server-only:  0.0.1 
    set-cookie-parser: ^2.6.0 => 2.6.0 
    setimmediate:  undefined ()
    shell-quote:  undefined ()
    shorthash2: ^1.0.3 => 1.0.3 
    source-map:  undefined ()
    stacktrace-parser:  undefined ()
    stream-browserify:  undefined ()
    stream-http:  undefined ()
    string-hash:  undefined ()
    string_decoder:  undefined ()
    strip-ansi:  undefined ()
    stripe: ^12.6.0 => 12.6.0 
    svelte-gantt: ^4.0.9-beta => 4.0.9-beta 
    tar:  undefined ()
    terser:  undefined ()
    text-table:  undefined ()
    timers-browserify:  undefined ()
    tty-browserify:  undefined ()
    ua-parser-js:  undefined ()
    undici:  undefined ()
    unistore:  undefined ()
    use-ssr: ^1.0.25 => 1.0.25 
    util:  undefined ()
    uuid: ^9.0.0 => 9.0.0 (8.3.2)
    vm-browserify:  undefined ()
    watchpack:  undefined ()
    web-vitals:  undefined ()
    webpack:  undefined ()
    webpack-sources:  undefined ()
    ws:  undefined ()
    zod:  undefined ()
    zustand: ^4.3.8 => 4.3.8 
  npmGlobalPackages:
    @nestjs/cli: 9.3.0
    crontab-ui: 0.3.15
    forest-cli: 3.4.0
    npm: 9.6.6
    serverless-python-requirements: 6.0.0
    twilio-cli: 3.1.0


Describe the bug

Build error occurred
2023-05-24T20:46:34.263Z [WARNING]: [Error: ENOENT: no such file or directory, lstat '/codebuild/output/src554686390/src/hkv_3_nextjs/.next/server/app'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/codebuild/output/src554686390/src/hkv_3_nextjs/.next/server/app'
}

Expected behavior

build should be completed

Reproduction steps

amplify connected to gitlab repo, auto deploy

Code Snippet

// Put your code below this line.

Log output

  # Starting phase: preBuild
                                 # Executing command: yarn install
2023-05-24T20:45:35.363Z [INFO]: yarn install v1.22.0
2023-05-24T20:45:35.428Z [WARNING]: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
2023-05-24T20:45:35.430Z [INFO]: [1/4] Resolving packages...
2023-05-24T20:45:35.588Z [INFO]: [2/4] Fetching packages...
2023-05-24T20:45:55.479Z [INFO]: info @next/[email protected]: The platform "linux" is incompatible with this module.
2023-05-24T20:45:55.482Z [INFO]: info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
                                 info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
                                 info @next/[email protected]: The platform "linux" is incompatible with this module.
                                 info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
                                 info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
                                 info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
                                 info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
                                 info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
                                 info @next/[email protected]: The platform "linux" is incompatible with this module.
                                 info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
                                 info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
                                 info @next/[email protected]: The platform "linux" is incompatible with this module.
                                 info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
                                 info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
                                 info @next/[email protected]: The platform "linux" is incompatible with this module.
                                 info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
                                 info [email protected]: The platform "linux" is incompatible with this module.
                                 info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2023-05-24T20:45:55.486Z [INFO]: [3/4] Linking dependencies...
2023-05-24T20:45:55.487Z [WARNING]: warning " > @rsuite/[email protected]" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
2023-05-24T20:45:55.489Z [WARNING]: warning "eslint-config-next > @typescript-eslint/parser > @typescript-eslint/typescript-estree > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
2023-05-24T20:45:55.491Z [WARNING]: warning " > [email protected]" has unmet peer dependency "moment@^2.22.2".
2023-05-24T20:46:02.174Z [INFO]: [4/4] Building fresh packages...
2023-05-24T20:46:02.263Z [INFO]: Done in 26.90s.
2023-05-24T20:46:02.285Z [INFO]: # Completed phase: preBuild
                                 # Starting phase: build
                                 # Executing command: yarn run build
2023-05-24T20:46:02.409Z [INFO]: yarn run v1.22.0
2023-05-24T20:46:02.436Z [INFO]: $ next build
2023-05-24T20:46:02.712Z [INFO]: - info Loaded env from /codebuild/output/src554686390/src/hkv_3_nextjs/.env
2023-05-24T20:46:02.925Z [WARNING]: - warn Invalid next.config.js options detected:
2023-05-24T20:46:02.925Z [WARNING]: - warn     The value at .experimental has an unexpected property, outputStandalone, which is not in the list of allowed properties (appDocumentPreloading, adjustFontFallbacks, adjustFontFallbacksWithSizeAdjust, allowedRevalidateHeaderKeys, amp, clientRouterFilter, clientRouterFilterRedirects, clientRouterFilterAllowedRate, cpus, memoryBasedWorkersCount, craCompat, disableOptimizedLoading, disablePostcssPresetEnv, esmExternals, appDir, serverActions, extensionAlias, externalDir, externalMiddlewareRewritesResolve, fallbackNodePolyfills, fetchCacheKeyPrefix, forceSwcTransforms, fullySpecified, gzipSize, incrementalCacheHandlerPath, isrFlushToDisk, isrMemoryCacheSize, largePageDataBytes, legacyBrowsers, manualClientBasePath, middlewarePrefetch, newNextLinkBehavior, nextScriptWorkers, optimizeCss, optimisticClientCache, outputFileTracingRoot, outputFileTracingExcludes, outputFileTracingIgnores, outputFileTracingIncludes, pageEnv, proxyTimeout, serverComponentsExternalPackages, scrollRestoration, sharedPool, sri, strictNextHead, swcFileReading, swcMinify, swcPlugins, swcTraceProfiling, urlImports, workerThreads, webVitalsAttribution, mdxRs, typedRoutes, webpackBuildWorker, turbo, instrumentationHook, turbotrace, logging).
                                    - warn See more info here: https://nextjs.org/docs/messages/invalid-next-config
2023-05-24T20:46:02.926Z [WARNING]: - warn You have enabled experimental feature (outputStandalone) in next.config.js.
2023-05-24T20:46:02.926Z [WARNING]: - warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
2023-05-24T20:46:02.928Z [INFO]: - warn No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2023-05-24T20:46:02.947Z [INFO]: Attention: Next.js now collects completely anonymous telemetry regarding usage.
2023-05-24T20:46:02.947Z [INFO]: This information is used to shape Next.js' roadmap and prioritize features.
                                 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
                                 https://nextjs.org/telemetry
2023-05-24T20:46:03.044Z [INFO]: - info Creating an optimized production build...
2023-05-24T20:46:18.793Z [INFO]: - info Compiled successfully
2023-05-24T20:46:18.802Z [INFO]: - info Linting and checking validity of types...
2023-05-24T20:46:20.310Z [INFO]: - info Collecting page data...
2023-05-24T20:46:33.833Z [INFO]: - info Generating static pages (0/4)
2023-05-24T20:46:33.873Z [WARNING]: Usage of <Dropdown> within <Nav> is deprecated. Replace with <Nav.Menu>
2023-05-24T20:46:33.874Z [WARNING]: Usage of <Dropdown.Item> within <Nav> is deprecated. Replace with <Nav.Item> within <Nav.Menu>.
2023-05-24T20:46:33.948Z [INFO]: - info Generating static pages (1/4)
2023-05-24T20:46:33.987Z [INFO]: - info Generating static pages (2/4)
2023-05-24T20:46:33.996Z [INFO]: - info Generating static pages (3/4)
2023-05-24T20:46:34.003Z [INFO]: - info Generating static pages (4/4)
2023-05-24T20:46:34.246Z [INFO]: - info Finalizing page optimization...
2023-05-24T20:46:34.249Z [INFO]: 
2023-05-24T20:46:34.261Z [WARNING]: 
2023-05-24T20:46:34.261Z [WARNING]: > Build error occurred
2023-05-24T20:46:34.263Z [WARNING]: [Error: ENOENT: no such file or directory, lstat '/codebuild/output/src554686390/src/hkv_3_nextjs/.next/server/app'] {
                                    errno: -2,
                                    code: 'ENOENT',
                                    syscall: 'lstat',
                                    path: '/codebuild/output/src554686390/src/hkv_3_nextjs/.next/server/app'
                                    }
2023-05-24T20:46:34.294Z [WARNING]: error Command failed with exit code 1.
2023-05-24T20:46:34.294Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-05-24T20:46:34.299Z [ERROR]: !!! Build failed
2023-05-24T20:46:34.299Z [INFO]: Please check the supported SSR features to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/ssr-Amplify-support.html#supported-unsupported-features. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
2023-05-24T20:46:34.299Z [ERROR]: !!! Non-Zero Exit Code detected
2023-05-24T20:46:34.299Z [INFO]: # Starting environment caching...
2023-05-24T20:46:34.299Z [INFO]: # Environment caching completed
Terminating logging...

</details>


### 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_
@dgastudio dgastudio added the pending-triage Issue is pending triage label May 24, 2023
@cwomack cwomack self-assigned this May 24, 2023
@cwomack
Copy link
Member

cwomack commented May 24, 2023

Hello, @dgastudio 👋 and thanks for opening this issue. Can you share what version of Amplify you're currently using (didn't see it in your package.json above) along with possibly sharing what's in your next.cofig? Also, could you try deleting your node_modules folder along with your package-lock.json (or yarn.lock) file and try reinstalling your dependencies with either npm install or yarn install?

@dgastudio
Copy link
Author

Hello @cwomack
thank you for your response, but, i was wrong.
the issue is related with deployment to amplify, not with amplify-js itself
i have already fixed the issue, amplify does not support app dir in nextjs 13

thank you!

@cwomack
Copy link
Member

cwomack commented May 25, 2023

@dgastudio, appreciate the quick replies and confirmation. While there's still some polishing going on to fully support the new app directory feature with Next.js, there's some helpful documentation for it here. If you have further issues or questions, feel free to reply back or open a new issue as needed.

@cwomack cwomack removed the pending-triage Issue is pending triage label May 25, 2023
@dannyk08
Copy link

dannyk08 commented Jun 20, 2023

Hello!

I'm also getting the same error message in the AWS Amplify Console. The app builds fine locally.

2023-06-20T18:57:17.616Z [INFO]: # Completed phase: preBuild
                                 # Starting phase: build
                                 # Executing command: yarn run build
2023-06-20T18:57:17.739Z [INFO]: yarn run v1.22.0
2023-06-20T18:57:17.764Z [INFO]: $ next build
2023-06-20T18:57:18.257Z [INFO]: - warn No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2023-06-20T18:57:18.269Z [INFO]: Attention: Next.js now collects completely anonymous telemetry regarding usage.
2023-06-20T18:57:18.270Z [INFO]: This information is used to shape Next.js' roadmap and prioritize features.
                                 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
                                 https://nextjs.org/telemetry
2023-06-20T18:57:18.355Z [INFO]: - info Creating an optimized production build...
2023-06-20T18:57:37.258Z [WARNING]: (node:1645) [DEP_WEBPACK_MODULE_UPDATE_HASH] DeprecationWarning: Module.updateHash: Use new ChunkGraph API
                                    (Use `node --trace-deprecation ...` to show where the warning was created)
2023-06-20T18:57:40.508Z [INFO]: - info Compiled successfully
2023-06-20T18:57:40.533Z [INFO]: - info Linting and checking validity of types...
2023-06-20T18:57:44.194Z [INFO]: - info Collecting page data...
2023-06-20T18:57:59.130Z [INFO]: - info Generating static pages (0/6)
2023-06-20T18:57:59.197Z [INFO]: - info Generating static pages (1/6)
2023-06-20T18:57:59.219Z [INFO]: - info Generating static pages (2/6)
2023-06-20T18:57:59.235Z [INFO]: - info Generating static pages (4/6)
2023-06-20T18:57:59.251Z [INFO]: - info Generating static pages (6/6)
2023-06-20T18:57:59.591Z [INFO]: - info Finalizing page optimization...
2023-06-20T18:57:59.601Z [INFO]: 
2023-06-20T18:57:59.613Z [WARNING]: 
2023-06-20T18:57:59.613Z [WARNING]: > Build error occurred
2023-06-20T18:57:59.617Z [WARNING]: [Error: ENOENT: no such file or directory, lstat '/codebuild/output/src033679038/src/clarityfrontend/.next/server/app'] {
                                    errno: -2,
                                    code: 'ENOENT',
                                    syscall: 'lstat',
                                    path: '/codebuild/output/src033679038/src/clarityfrontend/.next/server/app'
                                    }
2023-06-20T18:57:59.652Z [WARNING]: error Command failed with exit code 1.
2023-06-20T18:57:59.652Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-06-20T18:57:59.657Z [ERROR]: !!! Build failed
2023-06-20T18:57:59.657Z [INFO]: Please check the supported SSR features to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/ssr-Amplify-support.html#supported-unsupported-features. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
2023-06-20T18:57:59.657Z [ERROR]: !!! Non-Zero Exit Code detected
2023-06-20T18:57:59.657Z [INFO]: # Starting environment caching...
2023-06-20T18:57:59.658Z [INFO]: # Uploading environment cache artifact...
2023-06-20T18:57:59.736Z [INFO]: # Uploaded environment cache artifact
2023-06-20T18:57:59.736Z [INFO]: # Environment caching completed

I reviewed the docs provided in the previous comment and I had them applied to my app already. Is there a specific setting I should be modifying to resolve this issue? Is there a version that is not conflicting that we can use?

Thanks!

@nadetastic
Copy link
Member

Hi @dannyk08 since it sounds like the issue is happening while deploying on Hosting. Due to this, I recommend either opening an issue with the Hosting repo, or finding a similar issue already open.

Thanks!

@dannyk08
Copy link

Hey @nadetastic
Thank you for getting back to me
I was able to figure out the issue and it was on me for not paying attention to the fact that the app folder is a special folder when using nextjs. The failed build would only happen on the cloud and I had no means of debugging but to try to revert a lot of changes.

Thanks for checking in!

@pedrocleal
Copy link

i found out that i can't have a folder named app inside of the src directory, just renamed and the cloud build was completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants