strapi / strapi-starter-next-corporate

Next.js starter for creating a corporate site with Strapi.
https://strapi-starter-next-corporate.vercel.app
MIT License
346 stars 94 forks source link

Trying to deploy this starter on vercel i get a build error TypeError: pages.map is not a function #15

Closed capsloq closed 3 years ago

capsloq commented 3 years ago

11:41:54.596 Cloning github.com/capsloq/capsloq-website-frontend (Branch: master, Commit: c3fa738) 11:41:55.796 Cloning completed in 1200ms 11:41:55.797 Analyzing source code... 11:41:56.571 Installing build runtime... 11:41:57.038 Build runtime installed: 466.721ms 11:41:57.982 Installing dependencies... 11:41:58.213 yarn install v1.22.4 11:41:58.227 warning package.json: No license field 11:41:58.274 warning cms-strapi@1.0.0: No license field 11:41:58.275 [1/4] Resolving packages... 11:41:58.595 [2/4] Fetching packages... 11:42:07.021 info fsevents@1.2.13: The platform "linux" is incompatible with this module. 11:42:07.021 info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. 11:42:07.024 info fsevents@2.1.3: The platform "linux" is incompatible with this module. 11:42:07.024 info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 11:42:07.027 [3/4] Linking dependencies... 11:42:07.028 warning " > @tailwindcss/typography@0.2.0" has incorrect peer dependency "tailwindcss@^1.5.0". 11:42:10.827 [4/4] Building fresh packages... 11:42:11.304 Done in 13.10s. 11:42:11.332 Running "yarn run build" 11:42:11.605 yarn run v1.22.4 11:42:11.619 warning package.json: No license field 11:42:11.628 $ next build 11:42:12.357 info - Creating an optimized production build... 11:42:12.428 Attention: Next.js now collects completely anonymous telemetry regarding usage. 11:42:12.428 This information is used to shape Next.js' roadmap and prioritize features. 11:42:12.428 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: 11:42:12.428 https://nextjs.org/telemetry 11:42:23.388 info - Compiled successfully 11:42:23.388 info - Collecting page data... 11:42:23.559 Warning: You have opted-out of Automatic Static Optimization due to getInitialProps in pages/_app. This does not opt-out pages with getStaticProps 11:42:23.559 Read more: https://err.sh/next.js/opt-out-auto-static-optimization 11:42:23.993 > Build error occurred 11:42:23.995 TypeError: pages.map is not a function 11:42:23.995 at getStaticPaths (/vercel/workpath0/frontend/.next/serverless/pages/[[...slug]].js:4571:23) 11:42:23.995 at processTicksAndRejections (internal/process/task_queues.js:97:5) 11:42:23.995 at async buildStaticPaths (/vercel/workpath0/frontend/node_modules/next/dist/build/utils.js:17:80) 11:42:23.995 at async Object.isPageStatic (/vercel/workpath0/frontend/node_modules/next/dist/build/utils.js:24:549) { 11:42:23.995 type: 'TypeError' 11:42:23.995 } 11:42:24.017 error Command failed with exit code 1. 11:42:24.017 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 11:42:24.027 Error: Command "yarn run build" exited with 1 11:42:26.171 Done with "package.json"

Fresh Fork, not sure why this is happening

capsloq commented 3 years ago

Solved it. For future reference i did forget to add the --template attribute to the npx command npx create-strapi-app backend --template https://github.com/strapi/strapi-template-corporate

Instead it installed a version of strapi backend where "pages" is not a content type therefore it threw the error.

remidej commented 3 years ago

Happy to hear you fixed your problem!