Fix dynamic absolute path import for Windows fix#477#571
Conversation
|
remove unnecessary indent change by auto lint
|
Hi, same error here. Will it be fixed soon? |
|
@PxlSyl follow this issue can help you timlrx/tailwind-nextjs-starter-blog#704 Im not sure when this PR will be accepted. |
|
Accept pls |
|
This pull request 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. |
|
Why was this closed? |
|
@aolyang I have merged the fix in timlrx/contentlayer2#7. Feel free to try out |
git clone https://github.com/aolyang/blogs.git contentlayer2-test --depth=1 # currently contentlayer version
cd contentlayer2-test
pnpm i
pnpm dev # it's fixed by patched, worksThen Don't forget remove pnpm rm contentlayer next-contentlayer -r
pnpm add contentlayer@npm:contentlayer2 `
> next-contentlayer@npm:next-contentlayer2 `
> -D
pnpm devURL error is gone (if I not use mdx frontmatter), but another problem appear, stucked by timlrx/contentlayer2#15 I will try it latter if the problem fixed. Say somthing complaint, dont be mind. |

this PR fix issue #477
according to nodejs/node#31710 and https://nodejs.org/api/url.html#url_url_pathtofileurl_path
steps
next-contentlyer-example/contentlayer.config.ts addonSuccess hookexport default makeSource({ contentDirPath: 'posts', documentTypes: [Post], + onSuccess: async (importData) => { + const { allDocuments } = await importData() + console.log('Contentlayer data successfully generated.', allDocuments.length) + } })next-contentlyer-examplewith no change, error occur.packages\@contentlayer\core\src\generation\generate-dotpkg.ts,yarn buildat root dir.win bash

debian
