shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.7k stars 1.27k forks source link

Missing styles after starting the dev mode following the guide installation #3461

Open easychen opened 3 hours ago

easychen commented 3 hours ago

Describe the bug

After following the guide to install, running npm run dev results in the following:

To Reproduce Steps to reproduce the behavior:

  1. Create a new directory and run npm init -y
  2. Install the necessary packages: npm i next react react-dom nextra nextra-theme-docs
  3. Create next.config.mjs
  4. Create theme.config.jsx
  5. Create pages/index.mdx
  6. Run npm run dev
image

Expected behavior
The initial page should load with styles.

Screenshots
image

Desktop :

Additional Notes Running npm run build && npm run start works as expected.

easychen commented 3 hours ago

package.json:

{
  "name": "doc",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "next": "^14.2.15",
    "nextra": "^3.0.12",
    "nextra-theme-docs": "^3.0.12",
    "react": "^18.3.1",
    "react-dom": "^18.3.1"
  }
}
dimaMachina commented 2 hours ago

Without providing runnable reproduction, I am unable to help

easychen commented 2 hours ago

I've zipped up the code( without node_modules ), can you check if it reproduces?

dimaMachina commented 2 hours ago

please create GitHub repo, I will not download untrusted .zip files

87xie commented 2 hours ago

Adding a pages/_app.jsx file may temporarily resolve this issue.

function App({ Component, pageProps }) {
  return <Component {...pageProps} />
}

export default App