Coder Social home page Coder Social logo

strapi / strapi-starter-next-corporate Goto Github PK

View Code? Open in Web Editor NEW
343.0 20.0 93.0 6.18 MB

Next.js starter for creating a corporate site with Strapi.

Home Page: https://strapi-starter-next-corporate.vercel.app

License: MIT License

JavaScript 97.54% CSS 2.46%
strapi nextjs jamstack starter

strapi-starter-next-corporate's Introduction

⛔ DEPRECATED

This repository is no longer maintained and only works for Strapi v3. You can find the latest Strapi v4 version of this starter on the starters-and-templates monorepo.


Strapi Starter Next Corporate Site

Next starter for creating a corporate site with Strapi.

View the live demoRead the blog post

screen-website

This starter is designed for flexibility. Using it, you'll be able to manage your website content entirely in Strapi, and get a Next app automatically generated. Marketing teams will be able to create pages and design their layout without help from developers.

This starter features:

  • Pages creation within Strapi, no code necessary
  • Fully flexible page structure: design the pages you want using UI Sections
  • 8 UI Sections out of the box: Hero, RichText, LargeVideo, Testimonials, Pricing, BottomActions, FeatureRows, FeatureColumns
  • Easy to theme with Tailwind
  • Static site generation with Next
  • An integrated Preview Mode, to view your pages on a private URL before publishing them
  • Content in multiple languages using i18n

This starter uses the Strapi corporate template

Check out all of our starters here

Getting started

Use our create-strapi-starter CLI to create your project.

npx create-strapi-starter@3 my-site next-corporate

The CLI will create a monorepo, install dependencies, and run your project automatically.

The Next frontend server will run here => http://localhost:3000

The Strapi backend server will run here => http://localhost:1337

Preview Mode

You can turn preview mode on with a URL like this:

http://localhost:3000/api/preview?secret=<preview-secret>&slug=<slug>

<preview-secret> is the secret token defined in your .env config, <slug> is the slug you entered in Strapi for your page.

While preview mode is on you can access draft pages just like you would published pages.

For example http://localhost:3000/secret would be available in preview mode.

A banner will remain under the navigation to let you know preview mode is on and it will also allow you to turn it off.

Customize your corporate site

To edit this website, you'll need to run both the frontend and the backend in your development environment.

Adding Sections

We have built sections for you, but you will likely want to add more to fit your needs. Follow these steps:

  • Create a new component in Strapi in the "sections" category
  • In the Content-Types Builder, open the Pages collection and check your new section on the contentSections field.
  • Create a React component that takes a data prop in /frontend/components/sections
  • To link your Strapi section to this React component, open /frontend/components/sections.js, and add an entry to the sectionComponents object.

Custom theme

We use Tailwind CSS for styling. To modify your page's look, you can edit the theme in /front/tailwind.config.js. Read the Tailwind docs to view all the changes you can make. For example, you can change the primary color like this:

const { colors } = require(`tailwindcss/defaultTheme`)

module.exports = {
  theme: {
    extend: {
      colors: {
        primary: colors.green,
      },
    },
  },
}

Deploying to production

You will need to deploy the frontend and backend projects separately. Here are the docs to deploy each one:

Don't forget to set up your environment variables on your production apps.

Here are the required ones for the frontend:

  • NEXT_PUBLIC_STRAPI_API_URL: URL of your Strapi backend, without trailing slash
  • PREVIEW_SECRET: a random string used to protect your preview pages

And for the backend:

  • FRONTEND_URL: URL of your frontend, without trailing slash
  • FRONTEND_PREVIEW_SECRET: token of Next.js preview mode defined on the frontend

Have fun using this starter!

strapi-starter-next-corporate's People

Contributors

advaiyalad avatar alexandrebodin avatar dependabot[bot] avatar maggie44 avatar markkaylor avatar remidej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

strapi-starter-next-corporate's Issues

Some fields are compulsory but not marked as such in Strapi

I was getting the following error message:

`[ ==] info - Generating static pages (1/7)
Error occurred prerendering page "/home". Read more: https://err.sh/next.js/prerender-error
TypeError: Cannot read property 'mime' of null
at /tmp/learners-block-website/frontend/.next/server/pages/[[...slug]].js:2487:20
at Array.map ()
at FeatureRowsGroup (/tmp/learners-block-website/frontend/.next/server/pages/[[...slug]].js:2468:20)
at d (/tmp/learners-block-website/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:498)
at $a (/tmp/learners-block-website/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:39:16)
at a.b.render (/tmp/learners-block-website/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:476)
at a.b.read (/tmp/learners-block-website/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:18)
at renderToString (/tmp/learners-block-website/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:54:364)
at Object.renderPage (/tmp/learners-block-website/frontend/node_modules/next/dist/next-server/server/render.js:50:851)
at Function.getInitialProps (/tmp/learners-block-website/frontend/.next/server/pages/_document.js:305:19)
info - Generating static pages (7/7)

Build error occurred
Error: Export encountered errors on following paths:
/home
at exportApp (/tmp/learners-block-website/frontend/node_modules/next/dist/export/index.js:25:1103)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async build (/tmp/learners-block-website/frontend/node_modules/next/dist/build/index.js:37:212)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

Turns out there are a bunch of fields that are compulsory, but not set as such in Strapi. This one was cause by Media in a FeatureRowsGroup. I have encountered at least one more but not been able to reproduce it to identify which caused the issue.

I'm not familiar enough with the platform, but either making these fields compulsory in Strapi, or coding in some defaults to stop it erroring would be helpful.

unable to deploy on local - Frontend

I followed the instructions and deployed this template; I see strapi coming up effortlessly (on mongodb). However the front end doesn't render and gives error.

/Users/shivaprasadkadoor/programs2102-2/clayart>yarn develop
yarn run v1.22.5
$ cross-env FORCE_COLOR=1 npm-run-all -l -p develop:*
$ wait-on http://localhost:1337/admin && yarn --cwd frontend develop
$ yarn --cwd backend develop
$ strapi develop
[develop:backend ]
[develop:backend ] Project information
[develop:backend ]
[develop:backend ] ┌────────────────────┬──────────────────────────────────────────────────┐
[develop:backend ] │ Time │ Sun Jun 20 2021 12:23:25 GMT+0530 (India Standa… │
[develop:backend ] │ Launched in │ 5041 ms │
[develop:backend ] │ Environment │ development │
[develop:backend ] │ Process PID │ 68430 │
[develop:backend ] │ Version │ 3.6.3 (node v14.16.1) │
[develop:backend ] │ Edition │ Community │
[develop:backend ] └────────────────────┴──────────────────────────────────────────────────┘
[develop:backend ]
[develop:backend ] Actions available
[develop:backend ]
[develop:backend ] Welcome back!
[develop:backend ] To manage your project 🚀, go to the administration panel at:
[develop:backend ] http://localhost:1337/admin
[develop:backend ]
[develop:backend ] To access the server ⚡️, go to:
[develop:backend ] http://localhost:1337
[develop:backend ]
[develop:backend ] [2021-06-20T06:53:26.067Z] debug HEAD /admin (13 ms) 200
warning package.json: No license field
$ next
[develop:frontend] ready - started server on 0.0.0.0:3000, url: http://localhost:3000
[develop:frontend] info - Loaded env from /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/.env.local
[develop:frontend] info - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
[develop:frontend] event - compiled successfully
[develop:frontend] event - build page: /next/dist/pages/_error
[develop:frontend] wait - compiling...
[develop:frontend] event - compiled successfully
[develop:backend ] [2021-06-20T06:53:45.582Z] debug GET /global?_locale=en (19 ms) 404
[develop:frontend] Not Found
[develop:frontend] Error: An error occured please try again
[develop:frontend] at fetchAPI (webpack-internal:///./utils/api.js:30:11)
[develop:frontend] at runMicrotasks ()
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[develop:frontend] at async getGlobalData (webpack-internal:///./utils/api.js:57:18)
[develop:frontend] at async Function.MyApp.getInitialProps (webpack-internal:///./pages/_app.js:109:24)
[develop:frontend] at async loadGetInitialProps (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/lib/utils.js:5:91)
[develop:frontend] at async renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/render.js:28:1494)
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:112:97
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:105:142
[develop:frontend] at async DevServer.renderToHTMLWithComponents (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:137:387)
[develop:frontend] at async DevServer.renderErrorToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:139:505)
[develop:frontend] at async DevServer.renderErrorToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:1380)
[develop:frontend] at async DevServer.renderError (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:138:1659)
[develop:frontend] event - build page: /[[...slug]]
[develop:frontend] wait - compiling...
[develop:frontend] event - compiled successfully
[develop:backend ] [2021-06-20T06:53:50.415Z] debug GET /pages?_locale=en (15 ms) 200
[develop:backend ] [2021-06-20T06:53:50.416Z] debug GET /pages?_locale=fr (11 ms) 200
[develop:backend ] [2021-06-20T06:53:50.436Z] debug GET /global?_locale=en (9 ms) 404
[develop:frontend] Not Found
[develop:frontend] Error: An error occured please try again
[develop:frontend] at fetchAPI (webpack-internal:///./utils/api.js:30:11)
[develop:frontend] at runMicrotasks ()
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[develop:frontend] at async getGlobalData (webpack-internal:///./utils/api.js:57:18)
[develop:frontend] at async Function.MyApp.getInitialProps (webpack-internal:///./pages/_app.js:109:24)
[develop:frontend] at async loadGetInitialProps (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/lib/utils.js:5:91)
[develop:frontend] at async renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/render.js:28:1494)
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:112:97
[develop:frontend] at async __wrapper (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/lib/coalesced-function.js:1:330)
[develop:frontend] at async DevServer.renderToHTMLWithComponents (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:137:114)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:138:923)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:578)
[develop:frontend] at async DevServer.render (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:75:236)
[develop:frontend] at async Object.fn (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:59:580)
[develop:frontend] at async Router.execute (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/router.js:25:67)
[develop:frontend] at async DevServer.run (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:69:1042)
[develop:backend ] [2021-06-20T06:53:50.454Z] debug GET /global?_locale=en (7 ms) 404
[develop:frontend] Not Found
[develop:frontend] Error: An error occured please try again
[develop:frontend] at fetchAPI (webpack-internal:///./utils/api.js:30:11)
[develop:frontend] at runMicrotasks ()
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[develop:frontend] at async getGlobalData (webpack-internal:///./utils/api.js:57:18)
[develop:frontend] at async Function.MyApp.getInitialProps (webpack-internal:///./pages/_app.js:109:24)
[develop:frontend] at async loadGetInitialProps (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/lib/utils.js:5:91)
[develop:frontend] at async renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/render.js:28:1494)
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:112:97
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:105:142
[develop:frontend] at async DevServer.renderToHTMLWithComponents (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:137:387)
[develop:frontend] at async DevServer.renderErrorToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:139:505)
[develop:frontend] at async DevServer.renderErrorToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:1380)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:138:1281)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:578)
[develop:frontend] at async DevServer.render (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:75:236)
[develop:frontend] at async Object.fn (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:59:580)
[develop:frontend] TypeError: Cannot set property 'pageProps' of undefined
[develop:frontend] at renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/render.js:48:31)
[develop:frontend] at runMicrotasks ()
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:112:97
[develop:frontend] at async __wrapper (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/lib/coalesced-function.js:1:330)
[develop:frontend] at async DevServer.renderToHTMLWithComponents (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:137:114)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:138:923)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:578)
[develop:frontend] at async DevServer.render (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:75:236)
[develop:frontend] at async Object.fn (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:59:580)
[develop:frontend] at async Router.execute (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/router.js:25:67)
[develop:frontend] at async DevServer.run (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:69:1042)
[develop:frontend] at async DevServer.handleRequest (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:34:504)
[develop:backend ] [2021-06-20T06:53:57.911Z] debug GET /pages?_locale=en (29 ms) 200
[develop:backend ] [2021-06-20T06:53:57.912Z] debug GET /pages?_locale=fr (20 ms) 200
[develop:backend ] [2021-06-20T06:53:57.941Z] debug GET /global?_locale=en (13 ms) 404
[develop:frontend] Not Found
[develop:frontend] Error: An error occured please try again
[develop:frontend] at fetchAPI (webpack-internal:///./utils/api.js:30:11)
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[develop:frontend] at async getGlobalData (webpack-internal:///./utils/api.js:57:18)
[develop:frontend] at async Function.MyApp.getInitialProps (webpack-internal:///./pages/_app.js:109:24)
[develop:frontend] at async loadGetInitialProps (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/lib/utils.js:5:91)
[develop:frontend] at async renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/render.js:28:1494)
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:112:97
[develop:frontend] at async __wrapper (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/lib/coalesced-function.js:1:330)
[develop:frontend] at async DevServer.renderToHTMLWithComponents (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:137:114)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:138:923)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:578)
[develop:frontend] at async DevServer.render (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:75:236)
[develop:frontend] at async Object.fn (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:59:580)
[develop:frontend] at async Router.execute (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/router.js:25:67)
[develop:frontend] at async DevServer.run (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:69:1042)
[develop:frontend] at async DevServer.handleRequest (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:34:504)
[develop:backend ] [2021-06-20T06:53:58.003Z] debug GET /global?_locale=en (47 ms) 404
[develop:frontend] Not Found
[develop:frontend] Error: An error occured please try again
[develop:frontend] at fetchAPI (webpack-internal:///./utils/api.js:30:11)
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[develop:frontend] at async getGlobalData (webpack-internal:///./utils/api.js:57:18)
[develop:frontend] at async Function.MyApp.getInitialProps (webpack-internal:///./pages/_app.js:109:24)
[develop:frontend] at async loadGetInitialProps (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/lib/utils.js:5:91)
[develop:frontend] at async renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/render.js:28:1494)
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:112:97
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:105:142
[develop:frontend] at async DevServer.renderToHTMLWithComponents (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:137:387)
[develop:frontend] at async DevServer.renderErrorToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:139:505)
[develop:frontend] at async DevServer.renderErrorToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:1380)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:138:1281)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:578)
[develop:frontend] at async DevServer.render (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:75:236)
[develop:frontend] at async Object.fn (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:59:580)
[develop:frontend] at async Router.execute (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/router.js:25:67)
[develop:frontend] TypeError: Cannot set property 'pageProps' of undefined
[develop:frontend] at renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/render.js:48:31)
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[develop:frontend] at async /Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:112:97
[develop:frontend] at async __wrapper (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/lib/coalesced-function.js:1:330)
[develop:frontend] at async DevServer.renderToHTMLWithComponents (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:137:114)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:138:923)
[develop:frontend] at async DevServer.renderToHTML (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/server/next-dev-server.js:35:578)
[develop:frontend] at async DevServer.render (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:75:236)
[develop:frontend] at async Object.fn (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:59:580)
[develop:frontend] at async Router.execute (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/router.js:25:67)
[develop:frontend] at async DevServer.run (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:69:1042)
[develop:frontend] at async DevServer.handleRequest (/Users/shivaprasadkadoor/programs2102-2/clayart/frontend/node_modules/next/dist/next-server/server/next-server.js:34:504)
[develop:backend ] [2021-06-20T06:54:02.728Z] debug GET /pages?_locale=en (11 ms) 200
[develop:backend ] [2021-06-20T06:54:02.729Z] debug GET /pages?_locale=fr (20 ms) 200
[develop:backend ] [2021-06-20T06:54:02.752Z] debug GET /global?_locale=en (13 ms) 404
[develop:fronte

My setup:
OS: Mac OS Big Sur V11.1
Node: v14.16.1
npm: 6.14.12
Screenshot 2021-06-20 at 12 29 35 PM

Please let me know how to overcome this issue.

Starter templates that rely on fontawesome produce errors so they can't be tried out...

Unable to try out this corporate template and the blog template because of an error installing the fortawesome dependency.

  npx create-strapi-starter my-project next-blog
  npx create-strapi-starter my-project next-corporate

Gives:

Error: Couldn't find package "@fortawesome/free-solid-svg-icons@^5.15.3" required by "@strapi/[email protected]" on the "npm" registry.
error Couldn't find package "@fortawesome/fontawesome-free@^5.15.3" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/free-brands-svg-icons@^5.15.3" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/free-brands-svg-icons@^5.15.2" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/fontawesome-free@^5.15.2" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/fontawesome-svg-core@^1.2.35" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/fontawesome-svg-core@^1.2.35" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/free-solid-svg-icons@^5.15.3" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/free-solid-svg-icons@^5.15.3" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/react-fontawesome@^0.1.14" required by "@strapi/[email protected]" on the "npm" registry
Error: Couldn't find package "@fortawesome/react-fontawesome@^0.1.14" required by "@strapi/[email protected]" on the "npm" registry.
Error: Couldn't find package "@fortawesome/free-solid-svg-icons@^5.15.3" required by "@strapi/[email protected]" on the "npm" registry.

The error seems to be because those packages were deprecated:
https://www.npmjs.com/package/@fortawesome/fontawesome-free-brands

https://github.com/FortAwesome/Font-Awesome/blob/master/UPGRADING.md#50x-to-510

Error while running CLI starter

While running the following command npx create-strapi-starter my-site next-corporate I get the following error:

Installing strapi/strapi-starter-next-corporate starter
⠸ Installing dependencies:This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: Command failed with exit code 1: npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/next
npm ERR! next@"^11.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^8.1.1-canary.54 || ^9.0.0" from [email protected]
npm ERR! node_modules/next-seo
npm ERR! next-seo@"^4.7.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/alex/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/alex/.npm/_logs/2021-08-08T10_05_53_062Z-debug.log
at makeError (/home/alex/.npm/_npx/ecd569b0a81a6814/node_modules/execa/lib/error.js:59:11)
at handlePromise (/home/alex/.npm/_npx/ecd569b0a81a6814/node_modules/execa/index.js:114:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async installWithLogs (/home/alex/.npm/_npx/ecd569b0a81a6814/node_modules/create-strapi-starter/utils/build-starter.js:82:3)
at async buildStarter (/home/alex/.npm/_npx/ecd569b0a81a6814/node_modules/create-strapi-starter/utils/build-starter.js:151:3)
⠹ Installing dependencies: ERR! A complete log of this run can be found in: npm ERR! /home/alex/.npm/_logs/2021-08-08T10_05_53_062Z-debug.log

Please, help how to resolve

Error using Preview mode: ReferenceError: locale is not defined

I set this starter project up locally with no customization, and I'm having issues getting preview mode to work. I get this error:

[develop:frontend] error - ReferenceError: locale is not defined
[develop:frontend]     at preview (C:\Users\username\Projects\projectname\frontend\.next\server\pages\api
\preview.js:36:5)
[develop:frontend]     at Object.apiResolver (C:\Users\username\Projects\projectname\frontend\node_module
s\next\dist\server\api-utils.js:101:15)
[develop:frontend]     at runMicrotasks (<anonymous>)
[develop:frontend]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[develop:frontend]     at async DevServer.handleApiRequest (C:\Users\username\Projects\projectname\fronte
nd\node_modules\next\dist\server\next-server.js:775:9)
[develop:frontend]     at async Object.fn (C:\Users\username\Projects\projectname\frontend\node_modules\n
ext\dist\server\next-server.js:666:37)
[develop:frontend]     at async Router.execute (C:\Users\username\Projects\projectname\frontend\node_modu
les\next\dist\server\router.js:205:32)
[develop:frontend]     at async DevServer.run (C:\Users\username\Projects\projectname\frontend\node_modul
es\next\dist\server\next-server.js:846:29)
[develop:frontend]     at async DevServer.run (C:\Users\username\Projects\projectname\frontend\node_modul
es\next\dist\server\dev\next-dev-server.js:355:20)
[develop:frontend]     at async DevServer.handleRequest (C:\Users\username\Projects\projectname\frontend\
node_modules\next\dist\server\next-server.js:292:20) {
[develop:frontend]   page: '/api/preview'
[develop:frontend] }
[develop:backend ] [2022-02-09 09:48:13.162] http: POST /graphql (9 ms) 400
[develop:frontend] TypeError: Cannot read property 'global' of undefined
[develop:frontend]     at getGlobalData (C:\Users\username\Projects\projectname\frontend\.next\server\pag
es\_app.js:628:22)
[develop:frontend]     at runMicrotasks (<anonymous>)
[develop:frontend]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[develop:frontend]     at async Function.MyApp.getInitialProps (C:\Users\username\Projects\projectname\fr
ontend\.next\server\pages\_app.js:249:24)
[develop:frontend]     at async Object.loadGetInitialProps (C:\Users\username\Projects\projectname\fronte
nd\node_modules\next\dist\shared\lib\utils.js:69:19)
[develop:frontend]     at async Object.renderToHTML (C:\Users\username\Projects\projectname\frontend\node
_modules\next\dist\server\render.js:314:17)
[develop:frontend]     at async doRender (C:\Users\username\Projects\projectname\frontend\node_modules\ne
xt\dist\server\next-server.js:1149:38)
[develop:frontend]     at async C:\Users\username\Projects\projectname\frontend\node_modules\next\dist\se
rver\next-server.js:1241:28
[develop:frontend]     at async C:\Users\username\Projects\projectname\frontend\node_modules\next\dist\se
rver\response-cache.js:64:36

Has anyone else encountered this? Is the localization plugin compatible with preview mode?

I tried to add a parameter to my preview url but it had no effect:

http://localhost:3000/api/preview?locale=en&secret=xxxxxxxxxxxxxxxxx&slug=secret

Windows 11
Node.js v14.18.3

How to enable preview mode

Great starter kit, loving it already.

However, I faced one issue. In your blog video, it shows how we can click a button on a page to preview it with NextJs. I don't see that button on my strapi admin ui.

Is there something I need to do to enable that?

Many thanks 🙏🏼

How can I solve error deploying to Heroku: "Middleware "strapi::session": App keys are required. "

I'm following the official instructions to deploy my strapi starter app to Heroku. The app runs fine locally. The only thing I left out in my deployment instructions were installing the PG node module (it is already installed because my local app uses Postgresql).

Accessing the Heroku logs, I see this:

error: Middleware "strapi::session": App keys are required. 
Please set app.keys in config/server.js (ex: keys: ['myKeyA', 'myKeyB'])

Maybe this is an important detail: I followed this process once, and everything worked. I was able to deploy to Heroku. I tried it again and it didn't work. I was thinking maybe Heroku had a problem with me re-using an app name, but I tried to name the app something different in Heroku and I still had the same error.

Is heroku looking in the wrong place for my server.js file? Should it be looking in my "./config/env/production" folder instead of my "./config" folder?

Per the instructions, here is my ./config/env/production/database.js

const parse = require('pg-connection-string').parse;
const config = parse(process.env.DATABASE_URL);

module.exports = ({ env }) => ({
  connection: {
    client: 'postgres',
    connection: {
      host: config.host,
      port: config.port,
      database: config.database,
      user: config.user,
      password: config.password,
      ssl: {
        rejectUnauthorized: false
      },
    },
    debug: false,
  },
});

Here is my ./config/env/production/server.js

module.exports = ({ env }) => ({
    url: env('MY_HEROKU_URL'),
});

And here is my ./config/server.js

module.exports = ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  app: {
    keys: env.array('APP_KEYS'),
  },
});

my package.json for good measure:

{
  "dependencies": {
    "@strapi/plugin-graphql": "^4.0.0",
    "@strapi/plugin-i18n": "4.0.6",
    "@strapi/plugin-users-permissions": "4.0.6",
    "@strapi/strapi": "4.0.6",
    "lodash.set": "^4.3.2",
    "pg": "8.6.0",
    "pg-connection-string": "^2.5.0"
  },
  "name": "backend",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "devDependencies": {},
  "author": {
    "name": "A Strapi developer"
  },
  "strapi": {
    "uuid": "f64b509e-2d95-4464-8d39-d6f0d1c7a31a",
    "template": "@strapi/template-corporate@^1.0.0",
    "starter": "@strapi/starter-next-corporate"
  },
  "engines": {
    "node": ">=12.x.x <=16.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT"
}

I'm running Node v14.18.3 and NPM v6.14.15

PREVIEW_SECRET not working

I deployed the project on my local env, but the value i set for PREVIEW_SECRET is not read by Stripe which is always using secret-token .
How to let Stripe get the env value?

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

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 [email protected]: No license field
11:41:58.275 [1/4] Resolving packages...
11:41:58.595 [2/4] Fetching packages...
11:42:07.021 info [email protected]: The platform "linux" is incompatible with this module.
11:42:07.021 info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
11:42:07.024 info [email protected]: The platform "linux" is incompatible with this module.
11:42:07.024 info "[email protected]" 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/[email protected]" 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

Unable to add new page

I was getting a goofy error trying to add a new page after deploying the template.

error: insert into "components_meta_metadata" ("meta_description", "meta_title", "twitter_card_type") values ($1, $2, $3) returning "id" - duplicate key value violates unique constraint "components_meta_metadata_pkey"

I'm using postgres. It seems like the id primary key sequence has to be altered.
SELECT * FROM components_meta_metadata_id_seq;
last_value for me was showing 3, but the template populated up to 10;
SELECT setval('components_meta_metadata_id_seq', 11, true);
lead me to a second but same issue on the pages
SELECT * FROM pages_id_seq;
last_value was set to one, template populated 8;
SELECT setval('pages_id_seq', 9, true);

I'm going to go through the rest of the sequences, I didn't see how to change this in the strapi so I did it through SQL. I'd be interested in seeing where this exists in the strapi so I can edit and send a PR

Warning: Failed prop type: The prop `link.text` is marked as required in `CustomLink`, but its value is `undefined`.

I just pulled down the application and followed the steps in the readme.

The back/ folder has no errors, but in the front/ folder I get the following output:

(base) xxxxx:front xxxx$ yarn dev
yarn run v1.21.1
warning package.json: No license field
$ next
ready - started server on http://localhost:3000
info  - Loaded env from /Users/xxx/dev/tmp/strapi-starter-next-corporate/front/.env.local
event - compiled successfully
event - build page: /next/dist/pages/_error
wait  - compiling...
event - compiled successfully
event - build page: /[[...slug]]
wait  - compiling...
event - compiled successfully
Warning: Failed prop type: The prop `link.text` is marked as required in `CustomLink`, but its value is `undefined`.
    in CustomLink (at testimonials-group.js:40)
    in TestimonialsGroup (at sections.js:33)
    in Section (at sections.js:65)
    in div (at sections.js:60)
    in Sections (at [[...slug]].js:28)
    in Fragment
    in DynamicPage (at _app.js:52)
    in div (at layout.js:24)
    in div (at layout.js:16)
    in div (at layout.js:14)
    in Layout (at _app.js:51)
    in Fragment
    in MyApp
    in Unknown
    in Context.Provider
    in Context.Provider
    in Context.Provider
    in Context.Provider
    in AppContainer

Large video doesn't work

I tried to use "Large video" in the starter but the video doesn't work, I upload the video correctly to the media and the frame of the video appears on the page but it doesn't play when I click on the "play" icon as shown in the screenshot.
Any idea how to fix this issue?
videoIssue

Cannot destructure property 'url' of 'media' as it is null.

i found error

TypeError: Cannot destructure property 'url' of 'media' as it is null.
[develop:frontend] at NextImage (D:\Z\zerolim\cmd and landing page\zero-cor\frontend.next\server\pages[[...slug]].js:424:5)
[develop:frontend] at processChild (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\react-dom\cjs\react-dom-server.node.development.js:3353:14)
[develop:frontend] at resolve (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\react-dom\cjs\react-dom-server.node.development.js:3270:5)
[develop:frontend] at ReactDOMServerRenderer.render (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\react-dom\cjs\react-dom-server.node.development.js:3753:22)
[develop:frontend] at ReactDOMServerRenderer.read (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\react-dom\cjs\react-dom-server.node.development.js:3690:29)
[develop:frontend] at renderToString (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\react-dom\cjs\react-dom-server.node.development.js:4298:27)
[develop:frontend] at Object.renderPage (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\next\dist\next-server\server\render.js:53:854)
[develop:frontend] at Function.getInitialProps (D:\Z\zerolim\cmd and landing page\zero-cor\frontend.next\server\pages_document.js:556:19)
[develop:frontend] at loadGetInitialProps (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\next\dist\next-server\lib\utils.js:5:101)
[develop:frontend] at renderToHTML (D:\Z\zerolim\cmd and landing page\zero-cor\frontend\node_modules\next\dist\next-server\server\render.js:53:1145)

Deploy locally

Although Heroku and Vercel provide smooth solutions, I'm experiencing the setup a bit overkill to test a starter app. The direction provided in this git might be more sustainable in the long run, but having a guide on how to run the app locally would be very much appreciated too!

Seeding data for development

Hi there,

The seed script seems to be missing from the back package, the back/README.md states to run yarn seed but there's no such script.

I notice there is a data dump in the project root, can that be imported to SQLite?

The mobile Menu Doesn't close

I'm pretty sure this is a nextjs problem but when you click on the contact page the page loads in the background but the menu doesn't close.
Screen Shot 2021-09-01 at 1 56 50 PM

Multi language use

Thanks for this corporate starter example, it’s a really helpful way to get insight into Strapi’s functionality.

Where I’m left a little hesitant is in incorporating multi-language support (a common function in corporate as elsewhere I’m sure). One would usually utilise JSON file systems allowing all the strings for each language to be kept tidily together and allow crowdin or weblate integration. What would the workflow look like in this Strapi-next-corporate scenario?

Build Error while using MongoDB

yarn create v1.22.10
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "[email protected]" with binaries:
- create-strapi-starter
[#################################################################################################################################################] 162/162?? Choose your installation type Custom (manual settings)
? Choose your default database client mongo
? Database name: irenehom
? Host: 127.0.0.1
? +srv connection: false
? Port (It will be ignored if you enable +srv): 27017
? Username:
? Password:
? Authentication database (Maybe "admin" or blank):
? Enable SSL connection: No

Creating a project with custom database options.
Creating a new Strapi application at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend.
Creating files.
Installing strapi/strapi-template-corporate template.
Dependencies installed successfully.

Your application was created at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend.

Available commands in your project:

yarn develop
Start Strapi in watch mode.

yarn start
Start Strapi without watch mode.

yarn build
Build Strapi admin panel.

yarn strapi
Display all available commands.

You can start by doing:

cd /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend
yarn develop

Creating Strapi starter frontend at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/frontend.
Installing strapi/strapi-starter-next-corporate starter
Dependencies installed successfully.
Dependencies installed successfully.
Starting the app
yarn run v1.22.10
$ cross-env FORCE_COLOR=1 npm-run-all -l -p develop:*
$ yarn --cwd backend develop
$ wait-on http://localhost:1337/admin && yarn --cwd frontend develop
$ strapi develop
[develop:backend ] Building your admin UI with development configuration ...
[develop:backend ] ℹ Compiling Webpack
[develop:backend ] (node:70382) ExperimentalWarning: Package name self resolution is an experimental feature. This feature could change at any time
[develop:backend ] ✔ Webpack: Compiled successfully in 26.72s
[develop:backend ] Error: global validation failed: _id: Cast to ObjectId failed for value "1" at path "_id"
[develop:backend ] at ValidationError.inspect (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/error/validation.js:47:26)
[develop:backend ] at formatValue (internal/util/inspect.js:693:31)
[develop:backend ] at inspect (internal/util/inspect.js:264:10)
[develop:backend ] at formatWithOptions (internal/util/inspect.js:1865:40)
[develop:backend ] at Object.Console. (internal/console/constructor.js:281:10)
[develop:backend ] at Object.log (internal/console/constructor.js:291:61)
[develop:backend ] at createEntry (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/config/functions/bootstrap.js:93:13)
[develop:backend ] at runMicrotasks ()
[develop:backend ] at processTicksAndRejections (internal/process/task_queues.js:97:5) {
[develop:backend ] errors: {
[develop:backend ] _id: CastError: Cast to ObjectId failed for value "1" at path "_id"
[develop:backend ] at ObjectId.cast (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/schema/objectid.js:269:11)
[develop:backend ] at ObjectId.SchemaType.applySetters (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/schematype.js:1075:12)
[develop:backend ] at model.$set (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:1250:20)
[develop:backend ] at model._handleIndex (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:1019:14)
[develop:backend ] at model.$set (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:960:22)
[develop:backend ] at model.Document (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:150:12)
[develop:backend ] at model.Model (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:106:12)
[develop:backend ] at new model (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:4686:15)
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:3052:22
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:3088:7
[develop:backend ] at Array.forEach ()
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:3087:15
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:5
[develop:backend ] at new Promise ()
[develop:backend ] at promiseOrCallback (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/helpers/promiseOrCallback.js:30:10)
[develop:backend ] at Function.create (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:3022:10) {
[develop:backend ] stringValue: '"1"',
[develop:backend ] messageFormat: undefined,
[develop:backend ] kind: 'ObjectId',
[develop:backend ] value: 1,
[develop:backend ] path: '_id',
[develop:backend ] reason: Error: Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
[develop:backend ] at new ObjectID (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/bson/lib/bson/objectid.js:59:11)
[develop:backend ] at castObjectId (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/cast/objectid.js:25:12)
[develop:backend ] at ObjectId.cast (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/schema/objectid.js:267:12)
[develop:backend ] at ObjectId.SchemaType.applySetters (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/schematype.js:1075:12)
[develop:backend ] at model.$set (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:1250:20)
[develop:backend ] at model._handleIndex (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:1019:14)
[develop:backend ] at model.$set (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:960:22)
[develop:backend ] at model.Document (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/document.js:150:12)
[develop:backend ] at model.Model (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:106:12)
[develop:backend ] at new model (/Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:4686:15)
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:3052:22
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:3088:7
[develop:backend ] at Array.forEach ()
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/model.js:3087:15
[develop:backend ] at /Users/avinleo/Documents/WorkRepos/strapi/irenehom/backend/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:5
[develop:backend ] at new Promise ()
[develop:backend ] }
[develop:backend ] },
[develop:backend ] _message: 'global validation failed'
[develop:backend ] }

Strapi V4 form changes (fix error with form submission)

Hey guys,

Strapi v4 requires post requests to be wrapped in with "data". So in the /sections/lead-form.js edit this section:
body: JSON.stringify({ email: values.email, location: data.location }
body: JSON.stringify({data:{ email: values.email, location: data.location }}

Nested Compontents are not allowed

This Starter uses a 2-level nested component (footer->columns->links). This is not allowed (https://github.com/strapi/strapi/blob/4ab210eec65d7f1a4f6334cdef4c797b4e6b9531/packages/strapi-plugin-content-type-builder/controllers/validation/types.js#L247). When trying to change one field and saving it - e.g. removing the footer logo - an error on save occurs:

{
    "error": {
        "components[0].attributes.columns.component": [
            "footer-section already as a nested compoent. You cannot have more than one level of nesting inside your components."
        ]
    }
}

so much errors

This starter has a lot of issues and it's needs to update it and make the necessary corrections. it is quite useless to mention them, because many of them have already been said and none have been properly corrected.

Error: true is not a PostCSS plugin

Hello.
Immediately after starting the dev server, I get the following errors -

ready - started server on http://localhost:3000
error - ./styles/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/next/dist/compiled/postcss-loader??__nextjs_postcss!./styles/index.css)
Error: true is not a PostCSS plugin

When you hit http://localhost:3000, you get an internal sever error with the following messages on the Terminal console -

event - build page: /next/dist/pages/_error
wait - compiling...
error - ./styles/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/next/dist/compiled/postcss-loader??__nextjs_postcss!./styles/index.css)
Error: true is not a PostCSS plugin
Error: Cannot find module '/Users/***/dev/js/corp-strapi-next/frontend/.next/build-manifest.json'

Any ideas on what the issue could be? Thank you.

Error 404 with predefined SSR path

I'm trying to add a new set of SSR pages alongside the SSG pages provided by the starter. From a fresh starter install, a basic example is to add test/index.js to pages.

// test/index.js
const Test = ({ data }) => {

  return (
    <div>
     <pre>{JSON.stringify(data, null, 2)}</pre>
    </div>
  )
}

export async function getServerSideProps() {
  const res = await fetch(`http://localhost:1337/pages/1`)
  const data = await res.json()

  return { props: { data } }
}
export default Test

Then configure a button to /test url. This will result in a 404 error. In development you can refresh to see the desired page at /test or directly navigate to the page. When deployed /test is always 404. I don't know if this is a Next.js issue or if has to do with how the starter is configured. Any help would be greatly appreciated. Thank you

Error when deploying the front-end app to Vercel

Hi there,

when I deploy to Vercel, I got these errors:

14:22:34.674 Error occurred prerendering page "/en". Read more: https://nextjs.org/docs/messages/prerender-error
14:22:34.674 TypeError: Cannot read property 'text' of null
14:22:34.674 at /vercel/path0/.next/server/pages/[[...slug]].js:3147:36
14:22:34.674 at Array.map (<anonymous>)
14:22:34.674 at FeatureRowsGroup (/vercel/path0/.next/server/pages/[[...slug]].js:3126:29)
14:22:34.674 at d (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
14:22:34.674 at bb (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
14:22:34.674 at a.b.render (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
14:22:34.674 at a.b.read (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
14:22:34.674 at exports.renderToString (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
14:22:34.674 at Object.renderPage (/vercel/path0/node_modules/next/dist/next-server/server/render.js:54:854)
14:22:34.674 at Function.getInitialProps (/vercel/path0/.next/server/pages/_document.js:761:19)
14:22:35.200 info - Generating static pages (4/8)
14:22:35.216 Not Found
14:22:35.217 Error occurred prerendering page "/fr/[[...slug]]". Read more: https://nextjs.org/docs/messages/prerender-error
14:22:35.217 Error: An error occured please try again
14:22:35.217 at fetchAPI (/vercel/path0/.next/server/pages/_app.js:574:11)
14:22:35.217 at processTicksAndRejections (internal/process/task_queues.js:93:5)
14:22:35.217 at async getGlobalData (/vercel/path0/.next/server/pages/_app.js:601:18)
14:22:35.217 at async Function.module.exports.1TCz.MyApp.getInitialProps (/vercel/path0/.next/server/pages/_app.js:299:24)
14:22:35.217 at async loadGetInitialProps (/vercel/path0/node_modules/next/dist/next-server/lib/utils.js:5:91)
14:22:35.217 at async renderToHTML (/vercel/path0/node_modules/next/dist/next-server/server/render.js:28:1494)
14:22:35.217 at async /vercel/path0/node_modules/next/dist/export/worker.js:26:6
14:22:35.217 at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
14:22:35.241 info - Generating static pages (6/8)
14:22:35.746 Not Found
14:22:35.747 Error occurred prerendering page "/fr/500". Read more: https://nextjs.org/docs/messages/prerender-error
14:22:35.747 Error: An error occured please try again
14:22:35.747 at fetchAPI (/vercel/path0/.next/server/pages/_app.js:574:11)
14:22:35.747 at processTicksAndRejections (internal/process/task_queues.js:93:5)
14:22:35.747 at async getGlobalData (/vercel/path0/.next/server/pages/_app.js:601:18)
14:22:35.747 at async Function.module.exports.1TCz.MyApp.getInitialProps (/vercel/path0/.next/server/pages/_app.js:299:24)
14:22:35.747 at async loadGetInitialProps (/vercel/path0/node_modules/next/dist/next-server/lib/utils.js:5:91)
14:22:35.747 at async renderToHTML (/vercel/path0/node_modules/next/dist/next-server/server/render.js:28:1494)
14:22:35.747 at async /vercel/path0/node_modules/next/dist/export/worker.js:26:6
14:22:35.747 at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
14:22:35.760 info - Generating static pages (8/8)
14:22:35.763 > Build error occurred
14:22:35.763 Error: Export encountered errors on following paths:
14:22:35.763 /en
14:22:35.763 /fr/500
14:22:35.763 /fr/[[...slug]]
14:22:35.763 at /vercel/path0/node_modules/next/dist/export/index.js:31:1106
14:22:35.763 at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
14:22:35.763 at async /vercel/path0/node_modules/next/dist/build/index.js:43:49
14:22:35.764 at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
14:22:35.764 at async /vercel/path0/node_modules/next/dist/build/index.js:25:1475
14:22:35.764 at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:5:584)
14:22:35.807 error Command failed with exit code 1.
14:22:35.807 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
14:22:35.824 Error: Command "yarn run build" exited with 1

Please let me know what is the issue here, thanks

No preview mode button

Hi there, thanks for creating this starter project.

Unfortunately from a fresh install following all of the instructions in the README I end up with a Strapi instance which doesn't have a preview button. Am I missing something?

image

This happens even if the page is in draft mode, and once the env variables are set.

Full video demonstrating from setup: https://streamable.com/8gw8c6

Engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "15.3.0"

Command used:
yarn create strapi-starter strapi-next-corporate next-corporate

Version:
yarn create v1.22.10

Execution stops after the following messages:
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "15.3.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.