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

Build Failed with Module not found: Can't resolve '_http_common' in '.../node_modules/@prisma/client/runtime' #2

Open
sgargel opened this issue May 16, 2022 · 0 comments

Comments

@sgargel
Copy link

sgargel commented May 16, 2022

I'm trying to build your repo with Amplify but i'm stuck with this error:

2022-05-16T07:52:27.359Z [INFO]: Starting SSR Build...
2022-05-16T07:54:01.064Z [ERROR]: Error: Command failed with exit code 1: node_modules/.bin/next build
                                  warn  - The `target` config is deprecated and will be removed in a future version.
                                  See more info here https://nextjs.org/docs/messages/deprecated-target-config
                                  Browserslist: caniuse-lite is outdated. Please run:
                                  npx browserslist@latest --update-db
                                  Why you should do it regularly:
                                  https://github.com/browserslist/browserslist#browsers-data-updating
                                  Browserslist: caniuse-lite is outdated. Please run:
                                  npx browserslist@latest --update-db
                                  Why you should do it regularly:
                                  https://github.com/browserslist/browserslist#browsers-data-updating
                                  Failed to compile.
                                  ./node_modules/@prisma/client/runtime/index.js
                                  Module not found: Can't resolve '_http_common' in '/codebuild/output/src973477742/src/next-amplify/node_modules/@prisma/client/runtime'
                                  Import trace for requested module:
                                  ./node_modules/.prisma/client/index.js
                                  ./node_modules/@prisma/client/index.js
                                  ./lib/prisma.ts
                                  ./pages/api/auth/[...nextauth].ts
                                  ./node_modules/next/dist/build/webpack/loaders/next--loader/index.js?page=%2Fapi%2Fauth%2F%5B...nextauth%5D&absolutePagePath=private-next-pages%2Fapi%2Fauth%2F%5B...nextauth%5D.ts&absoluteAppPath=private-next-pages%2F_app.tsx&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=ymXT7OBVf0MrBdiMHQiKo&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22761daa41baba7733d2d3e553a423aec4%22%2C%22previewModeSigningKey%22%3A%2289ffa977529fa0a9c1f7fdc7d8611a7f913aaa9782a442783d9cb4029596a512%22%2C%22previewModeEncryptionKey%22%3A%22c884febf9c8d524d16d6a608c77f5911ad482b1ac8f1db83a8c3875d353c7bfd%22%7D&loadedEnvFiles=W10%3D&i18n=!
                                  > webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias
                                  info  - Checking validity of types...
                                  info  - Creating an optimized production build...
                                  at makeError (/root/.//node_modules/execa/lib/error.js:60:11)
                                  at handlePromise (/root/.//node_modules/execa/index.js:118:26)
                                  at processTicksAndRejections (internal/process/task_queues.js:95:5)
                                  at async Builder.build (/root/.//node_modules/@sls-next/lambda-at-edge/dist/build.js:377:13)
                                  at async NextjsComponent.build (/root/.//node_modules/@sls-next/-component/dist/component.js:165:13)
                                  at async NextjsComponent.default (/root/.//node_modules/@sls-next/-component/dist/component.js:22:13)
                                  at async fn (/root/.npm/_npx/1336/lib/node_modules//node_modules/@/template/utils.js:280:41)
                                  at async Promise.all (index 0)
                                  at async executeGraph (/root/.npm/_npx/1336/lib/node_modules//node_modules/@/template/utils.js:294:3)
                                  at async Template.default (/root/.npm/_npx/1336/lib/node_modules//node_modules/@/template/.js:67:38)
                                  at async Object.runComponents (/root/.npm/_npx/1336/lib/node_modules//node_modules/@/cli/src/index.js:222:17) {
                                  shortMessage: 'Command failed with exit code 1: node_modules/.bin/next build',
                                  command: 'node_modules/.bin/next build',
                                  escapedCommand: '"node_modules/.bin/next" build',
                                  exitCode: 1,
                                  signal: undefined,
                                  signalDescription: undefined,
                                  stdout: 'info  - Checking validity of types...\n' +
                                  'info  - Creating an optimized production build...',
                                  stderr: 'warn  - The `target` config is deprecated and will be removed in a future version.\n' +
                                  'See more info here https://nextjs.org/docs/messages/deprecated-target-config\n' +
                                  'Browserslist: caniuse-lite is outdated. Please run:\n' +
                                  'npx browserslist@latest --update-db\n' +
                                  '\n' +
                                  'Why you should do it regularly:\n' +
                                  'https://github.com/browserslist/browserslist#browsers-data-updating\n' +
                                  'Browserslist: caniuse-lite is outdated. Please run:\n' +
                                  'npx browserslist@latest --update-db\n' +
                                  '\n' +
                                  'Why you should do it regularly:\n' +
                                  'https://github.com/browserslist/browserslist#browsers-data-updating\n' +
                                  'Failed to compile.\n' +
                                  '\n' +
                                  './node_modules/@prisma/client/runtime/index.js\n' +
                                  "Module not found: Can't resolve '_http_common' in '/codebuild/output/src973477742/src/next-amplify/node_modules/@prisma/client/runtime'\n" +
                                  '\n' +
                                  'Import trace for requested module:\n' +
                                  './node_modules/.prisma/client/index.js\n' +
                                  './node_modules/@prisma/client/index.js\n' +
                                  './lib/prisma.ts\n' +
                                  './pages/api/auth/[...nextauth].ts\n' +
                                  './node_modules/next/dist/build/webpack/loaders/next--loader/index.js?page=%2Fapi%2Fauth%2F%5B...nextauth%5D&absolutePagePath=private-next-pages%2Fapi%2Fauth%2F%5B...nextauth%5D.ts&absoluteAppPath=private-next-pages%2F_app.tsx&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=ymXT7OBVf0MrBdiMHQiKo&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22761daa41baba7733d2d3e553a423aec4%22%2C%22previewModeSigningKey%22%3A%2289ffa977529fa0a9c1f7fdc7d8611a7f913aaa9782a442783d9cb4029596a512%22%2C%22previewModeEncryptionKey%22%3A%22c884febf9c8d524d16d6a608c77f5911ad482b1ac8f1db83a8c3875d353c7bfd%22%7D&loadedEnvFiles=W10%3D&i18n=!\n' +
                                  '\n' +
                                  '\n' +
                                  '> webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias',
                                  failed: true,
                                  timedOut: false,
                                  isCanceled: false,
                                  killed: false
                                  }

Any hints?

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

No branches or pull requests

1 participant