contentlayerdev / contentlayer

Contentlayer turns your content into data - making it super easy to import MD(X) and CMS content in your app
https://www.contentlayer.dev
MIT License
3.32k stars 201 forks source link

Contentlayer keeps generating files when used with Notion #537

Closed SharadKumar closed 1 year ago

SharadKumar commented 1 year ago

Once generated, contentlayer keeps generating files when used with Notion, every 5 seconds or so!

pnpm run dev

> yyy@0.0.1 dev /Users/xxx/GitHub/yyy
> concurrently "contentlayer dev" "next dev"

[1] - info Loaded env from /Users/sharad/GitHub/yyy/.env
[1] - ready started server on [::]:3001, url: http://localhost:3001
[0] ❌ Invalid environment variables: { NOTION_TOKEN: [ 'Required' ], NEXT_PUBLIC_APP_URL: [ 'Required' ] }
[0] ❌ Invalid environment variables: { NOTION_TOKEN: [ 'Required' ], NEXT_PUBLIC_APP_URL: [ 'Required' ] }
[0] ❌ Invalid environment variables: { NOTION_TOKEN: [ 'Required' ], NEXT_PUBLIC_APP_URL: [ 'Required' ] }
[0] ❌ Invalid environment variables: { NOTION_TOKEN: [ 'Required' ], NEXT_PUBLIC_APP_URL: [ 'Required' ] }
[0] ConfigReadError (/Users/xxx/GitHub/yyy/contentlayer.config.js): Error: Invalid environment variables
[0] ConfigReadError (/Users/xxx/GitHub/yyy/contentlayer.config.js): Error: Invalid environment variables
[1] - event compiled client and server successfully in 888 ms (20 modules)
[1] Notion Token: secret_OQprhMT1xYMneqwercsLG6cqA4SRHobG7KwILRp4cMBy
[1] Notion Token: secret_OQprhMT1xYMneqwercsLG6cqA4SRHobG7KwILRp4cMBy
[1] Contentlayer config change detected. Updating type definitions and data...
[1] - wait compiling...
[1] - event compiled client and server successfully in 71 ms (20 modules)
[1] - info Loaded env from /Users/xxx/GitHub/yyy/.env
[1] Generated 3 documents in .contentlayer
[1] Generated 3 documents in .contentlayer
[1] Generated 3 documents in .contentlayer
[1] Generated 3 documents in .contentlayer
[1] Generated 3 documents in .contentlayer
[1] Generated 3 documents in .contentlayer
[1] Generated 3 documents in .contentlayer

package.json:

"pnpm": {
    "overrides": {
      "@opentelemetry/api": "1.4.1",
      "@opentelemetry/core": "1.13.0",
      "@opentelemetry/exporter-trace-otlp-grpc": "0.39.1",
      "@opentelemetry/resources": "1.13.0",
      "@opentelemetry/sdk-trace-base": "1.13.0",
      "@opentelemetry/sdk-trace-node": "1.13.0",
      "@opentelemetry/semantic-conventions": "1.13.0"
    }
  },
  "dependencies": {
    "@notion-render/client": "^0.0.2",
    "@notionhq/client": "^2.2.11",
    "@radix-ui/react-slot": "^1.0.2",
    "@t3-oss/env-nextjs": "^0.6.0",
    "class-variance-authority": "^0.4.0",
    "clsx": "^1.2.1",
    "contentlayer": "^0.3.2",
    "contentlayer-source-notion": "0.0.1-alpha.26",
    "date-fns": "^2.30.0",
    "lucide-react": "0.263.1",
    "next": "^13.4.17",
    "next-contentlayer": "^0.3.2",
    "next-themes": "^0.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "sharp": "^0.31.3",
    "tailwind-merge": "^1.14.0",
    "tailwindcss-animate": "^1.0.6",
    "zod": "^3.22.1"
  },
  "devDependencies": {
    "@ianvs/prettier-plugin-sort-imports": "^3.7.2",
    "@tailwindcss/typography": "^0.5.9",
    "@types/node": "^17.0.45",
    "@types/react": "^18.2.20",
    "@types/react-dom": "^18.2.7",
    "@typescript-eslint/parser": "^5.62.0",
    "autoprefixer": "^10.4.15",
    "concurrently": "^8.2.0",
    "dotenv": "^16.3.1",
    "eslint": "^8.47.0",
    "eslint-config-next": "13.0.0",
    "eslint-config-prettier": "^8.10.0",
    "eslint-plugin-react": "^7.33.2",
    "eslint-plugin-tailwindcss": "^3.13.0",
    "postcss": "^8.4.28",
    "prettier": "^2.8.8",
    "rehype": "^12.0.1",
    "rehype-autolink-headings": "^6.1.1",
    "rehype-pretty-code": "^0.9.11",
    "rehype-slug": "^5.1.0",
    "remark": "^14.0.3",
    "remark-gfm": "^3.0.1",
    "tailwindcss": "^3.3.3",
    "typescript": "^4.9.5"
  }

Above problem of env loading is a separate issue #536 @transitive-bullshit @kerwanp

SharadKumar commented 1 year ago

This just goes on and on :-/

[1] Generated 5 documents in .contentlayer
[1] - wait compiling...
[1] - event compiled successfully in 47 ms (282 modules)
[1] Generated 5 documents in .contentlayer
[1] - wait compiling...
[1] - event compiled successfully in 56 ms (282 modules)
[1] Generated 5 documents in .contentlayer
[1] - wait compiling...
[1] - event compiled successfully in 51 ms (282 modules)
[1] Generated 5 documents in .contentlayer
[1] - wait compiling...
[1] - event compiled successfully in 43 ms (282 modules)
[1] Generated 5 documents in .contentlayer
[1] - wait compiling...
[1] - event compiled successfully in 53 ms (282 modules)
[1] Generated 5 documents in .contentlayer
[1] - wait compiling...
[1] - event compiled successfully in 44 ms (282 modules)
[1] Generated 5 documents in .contentlayer
[1] - wait compiling...
[1] - event compiled successfully in 44 ms (282 modules)
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.