Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contentlayer is no longer maintained and causing multiple build errors on first try #844

Closed
eltel opened this issue Feb 3, 2024 · 10 comments · Fixed by #881
Closed

Contentlayer is no longer maintained and causing multiple build errors on first try #844

eltel opened this issue Feb 3, 2024 · 10 comments · Fixed by #881
Labels
bug Something isn't working

Comments

@eltel
Copy link

eltel commented Feb 3, 2024

Describe the bug
A clear and concise description of what the bug is.
Loads of build errors on first try due to contentlayer

To Reproduce
Steps to reproduce the behavior:
download zip of repo, open zip and npm install dependencies

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.
the app to build out of the box

Screenshots
If applicable, add screenshots to help explain your problem.
image

System Info (if dev / build issue):

  • OS: [e.g. iOS] Linux Fedora 39, VSCode latest
  • Node version (please ensure you are using 18+)
  • 18.18
  • Npm version
  • 10.2.5

Browser Info (if display / formatting issue):

  • Device [e.g. Desktop, iPhone6]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
I think V3 should abandon contentlayer if it's not being maintained/causing dependency issues

Many thanks

Terry

@eltel eltel added the bug Something isn't working label Feb 3, 2024
@eltel
Copy link
Author

eltel commented Feb 3, 2024

Describe the bug A clear and concise description of what the bug is. Loads of build errors on first try due to contentlayer

To Reproduce Steps to reproduce the behavior: download zip of repo, open zip and npm install dependencies

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen. the app to build out of the box

Screenshots If applicable, add screenshots to help explain your problem. image

System Info (if dev / build issue):

  • OS: [e.g. iOS] Linux Fedora 39, VSCode latest
  • Node version (please ensure you are using 18+)
  • 18.18
  • Npm version
  • 10.2.5

Browser Info (if display / formatting issue):

  • Device [e.g. Desktop, iPhone6]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here. I think V3 should abandon contentlayer if it's not being maintained/causing dependency issues

Many thanks

Terry

OK, upon restoring the Yarn lock file and using Yarn instead of NPM (I generally find NPM far more stable on my devices) I was able to build successfully - however there are still multiple warnings for Contentlayer and I'm a littlw worried about this going forward in regards to maintaining updated dependencies, etc. Is there any news on what's happening regarding Contentlayer?

Many thanks for all your work

Terry

@timlrx
Copy link
Owner

timlrx commented Feb 4, 2024

I am trying to get it updated- contentlayerdev/contentlayer#638, otherwise I might just maintain a fork of it.

@d90375
Copy link

d90375 commented Feb 5, 2024

@timlrx How long may it take to fix a problem with Contentlayer ? I wanna to use your blog starter kit ^^

@timlrx
Copy link
Owner

timlrx commented Feb 5, 2024

@d90375 any specific problem you faced? Or just in general. The current setup with the blog actually works fine using yarn as eltel noted above. Npm complains about some peer dependency issues but you can just skip them. On the unified / markdown packages side, you just have to use the older version of most packages as the blog does or add a // @ts-ignore line above every plugin as the typing have changed.

So mostly minor inconveniences. In any case, if it were to be updated, the main change would just be to bump up the package versions - I don't expect much changes required.

@eltel
Copy link
Author

eltel commented Feb 5, 2024

I am trying to get it updated- contentlayerdev/contentlayer#638, otherwise I might just maintain a fork of it.

That sounds like a good move. Thanks for getting back to me - looking forward to continuing to use what is, IMO, one of the best starter templates for Next.js.

Thanks again for all you do.

@eltel
Copy link
Author

eltel commented Feb 29, 2024

So, as an update on this - I've just tried to update my dependencies, and it seems contentlayer is now preventing the build on Vercel. Did you manage to fork your own version?
This is just a heads up - here are the error logs (note the last line of the logs) -
✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-cd0db02b-fddd-4a2a-8147-d19533c06fe1.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-ea5ef452-2af7-414b-b9bc-c9e06a535441.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-68f48d16-da9d-4ca8-bad2-3999555a75da.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-f367951f-667a-4b89-967d-f63e95a1c123.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-d9992b45-bb20-4989-8eae-ce51dda6bf34.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-7eb5a662-5e07-4a47-ace9-13979638dbbc.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-4279a35d-73a3-4072-90f2-da710dcf9d28.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-545ede8d-d335-4b12-bcd9-a1a1f3cf16e8.mdx:0:0: 0 │ --- ╵ ^ ✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'inTable') at Object.exitCodeText (file:///vercel/path0/node_modules/mdast-util-gfm-table/lib/index.js:123:17) at compile (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:352:40) at fromMarkdown (file:///vercel/path0/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:187:29) at parser (file:///vercel/path0/node_modules/remark-parse/lib/index.js:18:12) at Function.parse (file:///vercel/path0/node_modules/unified/lib/index.js:273:12) at executor (file:///vercel/path0/node_modules/unified/lib/index.js:393:31) at new Promise (<anonymous>) at Function.process (file:///vercel/path0/node_modules/unified/lib/index.js:380:14) at process (file:///vercel/path0/node_modules/@mdx-js/mdx/lib/util/create-format-aware-processors.js:50:22) at onload (file:///vercel/path0/node_modules/@contentlayer/core/node_modules/@mdx-js/esbuild/lib/index.js:151:22) [plugin @mdx-js/esbuild] _mdx_bundler_entry_point-0986c8ca-934d-4677-91ff-1ffffebccb5c.mdx:0:0: 0 │ --- ╵ ^ Error: Found 9 problems in 13 documents. └── Encountered unexpected errors while processing of 9 documents. This is possibly a bug in Contentlayer. Please open an issue.

@jacobhuberdotme
Copy link

maybe i am looking in the wrong spot but their might have been a fix made? https://github.com/tudoujunha/next-contentlayer/blob/main/components/mdx-components.tsx

@dcmalk
Copy link

dcmalk commented Mar 8, 2024

Somewhere along the way I must have upgraded remark-gfm to v4 and this error started happening. I downgraded to v3.0.1 and it works again.

@cjambrosi
Copy link

I have the same problem with the Vercel deployment. Do you have any idea about changing the contentlayer lib to another tool? Does it indicate any?

@eltel
Copy link
Author

eltel commented Mar 10, 2024

Somewhere along the way I must have upgraded remark-gfm to v4 and this error started happening. I downgraded to v3.0.1 and it works again.

I'll give this a try. It's a pity, though, as I like to keep my dependencies up to date as much as possible. Downgrading always seems like just sticking a Bandaid on a bigger problem and invariably leads to dependency issues further down the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants