Open sandervspl opened 1 year ago
It should be able to run without a pages folder.
what is the purpose of building your app without pages
folder?
Nextra requires pages
folder to be present
more info https://github.com/shuding/nextra/discussions/1142#discussioncomment-4552759
Well, when you run "next build" your app is compiled into the ".next" folder. That is what I presume to be the entire app. A regular Next app works with just the ".next" folder after you build it. You can leave out the "pages" folder because that is only necessary for development.
That is not the case with Nextra. I need to add an empty "pages" folder for the production server to run.
I have updated the initial post to specify next start
. Obviously you need a pages folder for dev, but for next start
you don't need one because it's all compiled in to .next
If somebody wants to improve it, feel free to contribute
how specify the pages directory? for example, if I am using electron, the pages folder is inside renderer folder.
what's renderer folder
? provide an example
next start
can not run if there is nopages
folder present in the root directory. It should be able to run without a pages folder.How to reproduce
npx create-next-app@latest
TypeScript: Yes ESLint: No Tailwind: No src directory: Yes App Router: No customize import alias: No
npm i nextra nextra-theme-docs
npm run build
npm install
npm start
You should see the following error
When you add an empty
pages
folder it works again.I have tried running a regular Next server (so, without Nextra) and it will run without a
pages
folder.