Skip to content

Conversation

imadatyatalah
Copy link
Contributor

@imadatyatalah imadatyatalah commented Oct 18, 2021

Documentation / Examples

  • Make sure the linting passes

@ijjk ijjk added the examples Issue was opened via the examples template. label Oct 18, 2021
leerob
leerob previously approved these changes Nov 3, 2021
Added missed "
@imadatyatalah imadatyatalah requested a review from leerob November 4, 2021 12:47
@slavakurilyak
Copy link

+1 for Contentlayer example for MD or MDX file types

Working with content data (e.g. Markdown files or CMS) is a surprisingly difficult and laborious task when developing modern sites (e.g. with Next.js). Contentlayer is a content SDK that aims to make content easy for developers with a focus on great DX and performance. (contentlayer.dev)

contentlayer-02

Copy link
Contributor

@leerob leerob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kodiakhq kodiakhq bot merged commit 99b017e into vercel:canary May 22, 2022
@slavakurilyak
Copy link

@imadatyatalah When deploying this example on Vercel, I receive the following errors:

[20:23:29.828] Cloning github.com/slavakurilyak/with-contentlayer (Branch: main, Commit: a7b5390)
[20:23:30.420] Cloning completed: 591.528ms
[20:23:30.757] Installing build runtime...
[20:23:32.692] Build runtime installed: 1.935s
[20:23:33.417] Looking up build cache...
[20:23:33.673] Build Cache not found
[20:23:33.855] Installing dependencies...
[20:23:34.187] yarn install v1.22.17
[20:23:34.208] info No lockfile found.
[20:23:34.213] [1/4] Resolving packages...
[20:23:38.386] [2/4] Fetching packages...
[20:23:52.864] [3/4] Linking dependencies...
[20:23:52.864] warning "contentlayer > @contentlayer/source-files > date-fns-tz@1.3.4" has unmet peer dependency "date-fns@>=2.0.0".
[20:23:52.867] warning "contentlayer > @contentlayer/utils > @opentelemetry/exporter-trace-otlp-grpc > @opentelemetry/core@1.0.1" has incorrect peer dependency "@opentelemetry/api@>=1.0.0 <1.1.0".
[20:23:52.867] warning "contentlayer > @contentlayer/utils > @opentelemetry/exporter-trace-otlp-grpc > @opentelemetry/resources@1.0.1" has incorrect peer dependency "@opentelemetry/api@>=1.0.0 <1.1.0".
[20:23:52.867] warning "contentlayer > @contentlayer/utils > @opentelemetry/exporter-trace-otlp-grpc > @opentelemetry/sdk-trace-base@1.0.1" has incorrect peer dependency "@opentelemetry/api@>=1.0.0 <1.1.0".
[20:23:52.879] warning Workspaces can only be enabled in private projects.
[20:23:52.880] warning Workspaces can only be enabled in private projects.
[20:23:52.884] warning Workspaces can only be enabled in private projects.
[20:24:06.302] [4/4] Building fresh packages...
[20:24:08.236] success Saved lockfile.
[20:24:08.240] Done in 34.06s.
[20:24:08.277] Detected Next.js version: 12.1.6
[20:24:08.279] Running "yarn run build"
[20:24:08.540] yarn run v1.22.17
[20:24:08.570] $ next build
[20:24:10.820] Generated 2 documents in .contentlayer
[20:24:10.842] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[20:24:10.843] This information is used to shape Next.js' roadmap and prioritize features.
[20:24:10.843] 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:
[20:24:10.843] https://nextjs.org/telemetry
[20:24:10.843] 
[20:24:10.882] info  - Checking validity of types...
[20:24:11.000] warn  - No ESLint configuration detected. Run next lint to begin setup
[20:24:11.003] info  - Creating an optimized production build...
[20:24:16.085] Failed to compile.
[20:24:16.085] 
[20:24:16.086] ./pages/index.js
[20:24:16.086] Module not found: Package path ./generated is not exported from package /vercel/path0/node_modules/contentlayer (see exports field in /vercel/path0/node_modules/contentlayer/package.json)
[20:24:16.086] 
[20:24:16.086] ./pages/posts/[id].js
[20:24:16.086] Module not found: Package path ./generated is not exported from package /vercel/path0/node_modules/contentlayer (see exports field in /vercel/path0/node_modules/contentlayer/package.json)
[20:24:16.086] 
[20:24:16.087] 
[20:24:16.087] > Build failed because of webpack errors
[20:24:16.123] error Command failed with exit code 1.
[20:24:16.123] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[20:24:16.135] Error: Command "yarn run build" exited with 1

@leerob
Copy link
Contributor

leerob commented May 27, 2022

Ah yeah looks like there's a bug - @imadatyatalah would you be willing to address that?

@imadatyatalah
Copy link
Contributor Author

hey @slavakurilyak & @leerob, I have tried to deploy the example to Vercel and I got the same error, The error was just from the missed jsconfig.json file, I forget to add it sorry about that.

@slavakurilyak you can add a jsconfig.json file with this content and it will work.

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "contentlayer/generated": ["./.contentlayer/generated"]
    }
  },
  "include": [".contentlayer/generated"]
}

@leerob Should I add jsconfig.json file to this PR or create a new PR to fix this error?

@leerob
Copy link
Contributor

leerob commented May 27, 2022

If you could make a new PR, I'm happy to get it approved and merged!

@imadatyatalah
Copy link
Contributor Author

@leerob I have created a new PR #37257, Thanks @slavakurilyak for spotting this issue!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue was opened via the examples template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants