Closed eltel closed 5 months ago
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
- Go to '...'
- Click on '....'
- Scroll down to '....'
- 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.
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
I am trying to get it updated- https://github.com/contentlayerdev/contentlayer/pull/638, otherwise I might just maintain a fork of it.
@timlrx How long may it take to fix a problem with Contentlayer ? I wanna to use your blog starter kit ^^
@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.
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.
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.
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
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 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?
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.
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
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](https://github.com/timlrx/tailwind-nextjs-starter-blog/assets/4655660/bba3b83b-0851-48ed-8a63-3e67f77c0620)
System Info (if dev / build issue):
Browser Info (if display / formatting issue):
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