Skip to content

Next.js Page Router not working #404

@chosanghyeon-dev

Description

@chosanghyeon-dev

After setting up and running create-next-app, I get an error saying "SyntaxError: Unexpected token 'export'". For reference, I turned off Turbo Pack in the options.

Image

package.json

{
  "name": "playground",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint"
  },
  "dependencies": {
    "next": "15.5.4",
    "react": "19.1.0",
    "react-dom": "19.1.0"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "code-inspector-plugin": "^1.2.10",
    "eslint": "^9",
    "eslint-config-next": "15.5.4",
    "tailwindcss": "^4",
    "typescript": "^5"
  }
}

next.config.ts

import type { NextConfig } from "next";
import { codeInspectorPlugin } from "code-inspector-plugin";

const nextConfig: NextConfig = {
  /* config options here */
  reactStrictMode: true,
  webpack: (config) => {
    config.plugins.push(
      codeInspectorPlugin({
        bundler: "webpack",
      })
    );

    return config;
  },
};

export default nextConfig;

fyi. my create-next-app version

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    need confirmThis need to be confirmed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions