Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't Resolve '.contentlayer/data'

See original GitHub issue


I am looking to contribute to the Chakra Documentation, though I am running into the following error when spinning up the local server and attempt to navigate to any documentation page (Or selecting “Get Started” link on the landing page):

wait  - compiling /_error (client and server)...
error - ./pages/docs/[[...slug]].tsx:1:0
Module not found: Can't resolve '.contentlayer/data'
> 1 | import { allDocs } from '.contentlayer/data'
  2 | import type { Doc } from '.contentlayer/types'
  3 | import { MDXComponents } from 'components/mdx-components'
  4 | import { GetStaticPaths, GetStaticProps } from 'next'

The following steps to reach to this error:

  1. Fork chakra-ui/chakra-ui-docs
  2. Clone the fork to local
  3. Run yarn to install dependecies
  4. Run yarn dev to run local server
  5. Select the "Get Started " link on the landing page or query to a doc page in the address bar (i.e. http://localhost:3000/docs/disclosure/accordion)

I am noticing that both .contentlayer/data and .contentlayer/types show empty exports.

Also, the CONTRIBUTION files at the root and in the docs folder do not appear to be consistent in how to set up the local space for a PR.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

TylerAPfledderercommented, Feb 13, 2022
$ npx contentlayer build
Warning: Contentlayer might not work as expected on Windows
Generated 113 documents in node_modules/.contentlayer

Ran yarn dev and the docs are now successfully rendering. Thank you!

nikolovlazarcommented, Feb 13, 2022

Hello @TylerAPfledderer! I can’t seem to reproduce this issue. Did you try removing the node_modules and .contentlayer folders and running the yarn command again? Also, what version of node are you using?

As for the contribution guide, I’ve synced up the contents, feel free to pull from main.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contentlayer turns your content into data - GitHub
Contentlayer is a content SDK that validates and transforms your content into type-safe JSON data you can easily import into your application's pages....
Read more >
How to setup Contentlayer in your Next.js app?
Contentlayer turns your content into data - making it super easy to import MD(X) and CMS content in your app. Automatic Setup. The...
Read more >
Build a MDX-powered blog with Contentlayer and Next
In this article, we'll learn how to use Next.js and Contentlayer to create a static MDX blogging site in this tutorial.
Read more >
contentlayer: Versions - Openbase
When using source-files as the content source, you can now use an image field. This will process images that are colocated with your...
Read more >
Fixed div inside div with other div scrolling - Stack Overflow
try this: .contentlayer { text-align: center; } .innerlayer { animation: fadein 2s; position: fixed; left: 50%; top: 50%; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found