svelteness / kit-docs

Documentation integration for SvelteKit.
https://kitdocs.vercel.app
MIT License
476 stars 33 forks source link

pnpm build fails - (ELIFECYCLE  Command failed with exit code 1.) #31

Open oneezy opened 2 years ago

oneezy commented 2 years ago

I'm on a Windows 11 machine using Git Bash if that has anything to do with it. I can confirm the same issue is happening w/ npm run build also

here's the error up front for brevity

307 /docs -> /docs/first-category/first-page
- > 404 /docs/first-category/first-page" style="">                  Page Title                  </a>              </li><li class="first:mt-6"><a class="992:py-1.5 -ml-px flex items-center border-l-2 py-2 pl-4 hover:border-gray-inverse text-gray-soft hover:text-gray-inverse border-transparent font-normal" href="/docs/first-category/second-page" style="">                  Page Title                  </a>              </li><li class="first:mt-6"><a class="992:py-1.5 -ml-px flex items-center border-l-2 py-2 pl-4 hover:border-gray-inverse text-gray-soft hover:text-gray-inverse border-transparent font-normal" href="/docs/second-category/first-page" style="">                  Page Title                  </a>              </li><li class="first:mt-6"><a class="992:py-1.5 -ml-px flex items-center border-l-2 py-2 pl-4 hover:border-gray-inverse text-gray-soft hover:text-gray-inverse border-transparent font-normal" href="/docs/second-category/second-page" style="">                  Page Title                  </a>              </li></ul>        </li></ul>            </nav></aside><div class="992:hidden z-40"><div class="fixed top-0 left-0 bg-black/40 backdrop-blur-sm dark:bg-gray-700/80 transition-opacity duration-75 pointer-events-auto z-40 w-screen h-screen opacity-0 invisible"></div></div>    <main class="w-full overflow-x-hidden 992:min-h-[calc(100vh-var(--kd--navbar-height))] min-h-[calc(100vh-var(--kd--navbar-height))] px-8 992:px-16 pt-8" style="max-width: var(--kd-main-max-width, var(--kd-article-max-width));">      <article class="markdown prose dark:prose-invert z-10 max-w-[var(--kd-article-max-width)]">          <h1>Page Title</h1><p>Page description.</p></article>      <hr class="border-gray-divider mt-20">        <div class="992:text-xl flex items-center pt-12 pb-20 text-lg font-semibold text-gray-300">          <div class="ml-auto mb-4 flex flex-col items-end"><span class="text-gray-inverse mr-3 mb-4 inline-block">Next</span>                <a class="group transform-gpu text-lg font-medium transition-transform hover:scale-105 hover:text-gray-inverse" href="/docs/first-category/first-page" sveltekit:prefetch>    <span class="inline-block transform transition-transform duration-100 group-hover:translate-x-0 translate-x-2">Page Title</span>    <span class="opacity-0 transition-opacity duration-100 group-hover:visible group-hover:opacity-100 inline-block">-&gt;</span></a></div></div>      </main>    <div class="992:flex-1"></div>    </div></div><script type="module" data-sveltekit-hydrate="j7tozk">import { start } from "/_app/start-c57594a6.js";start({target: document.querySelector('[data-sveltekit-hydrate="j7tozk"]').parentNode,paths: {"base":"","assets":""},session: {},route: true,spa: false,trailing_slash: "never",hydrate: {status: 200,error: null,nodes: [import("/_app/pages/__layout-kit-docs.svelte-b66be7be.js"),import("/_app/pages/docs/__layout@kit-docs.svelte-63e6c25f.js"),import("/_app/pages/docs/_...1_first-category/_...1_first-page.md-4bc77492.js")],params: {"1":""},routeId: "docs/[...1]first-category/[...1]first-page"}});</script><script type="application/json" sveltekit:data-type="data" sveltekit:data-url="/kit-docs/docs_first-category_first-page.meta.json">{"status":200,"statusText":"","headers":{"content-type":"application/json; charset=utf-8"},"body":"{/"excerpt/":/"/",/"headers/":[],/"title/":/"Page Title/",/"description/":/"Page description./",/"frontmatter/":{/"title/":/"Page Title/",/"description/":/"Page description./"},/"lastUpdated/":1653269293192}"}</script><script type="application/json" sveltekit:data-type="data" sveltekit:data-url="/kit-docs/docs.sidebar.json">{"status":200,"statusText":"","headers":{"content-type":"application/json; charset=utf-8"},"body":"{/"links/":{/"./":[{/"title/":/"Page Title/",/"slug/":/"/docs////first-category////first-page/"},{/"title/":/"Page Title/",/"slug/":/"/docs////first-category////second-page/"},{/"title/":/"Page Title/",/"slug/":/"/docs////second-category////first-page/"},{/"title/":/"Page Title/",/"slug/":/"/docs////second-category////second-page/"}]}}"}</script></div></body></html> (linked from /docs/first-category/first-page)

    at file:///C:/Users/oneezy/Desktop/www/7.Testing/docs/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.338_svelte@3.48.0/node_modules/@sveltejs/kit/dist/chunks/index2.js:1037:11
    at save (file:///C:/Users/oneezy/Desktop/www/7.Testing/docs/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.338_svelte@3.48.0/node_modules/@sveltejs/kit/dist/chunks/index2.js:1257:4)
    at visit (file:///C:/Users/oneezy/Desktop/www/7.Testing/docs/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.338_svelte@3.48.0/node_modules/@sveltejs/kit/dist/chunks/index2.js:1148:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
- ELIFECYCLE  Command failed with exit code 1.

Here's the full log

oneezy@oneezy MINGW64 ~/Desktop/www/7.Testing/docs (main)
$ pnpm build

> docs@0.0.1 build C:\Users\oneezy\Desktop\www\7.Testing\docs
> svelte-kit build

vite v2.9.9 building for production...
✓ 100 modules transformed.
.svelte-kit/output/client/_app/assets/Inter-VF.roman-latin-1b58736b.woff2                          51.24 KiB
.svelte-kit/output/client/_app/assets/Inter-VF.italic-latin-65279caf.woff2                         55.21 KiB
.svelte-kit/output/client/_app/assets/FiraCode-VF-05b30ba3.woff2                                   103.74 KiB
.svelte-kit/output/client/_app/assets/FiraCode-VF-71c5868a.woff                                    127.05 KiB
.svelte-kit/output/client/_app/manifest.json                                                       4.78 KiB
.svelte-kit/output/client/_app/layout.svelte-5f25ab44.js                                           0.53 KiB / gzip: 0.35 KiB
.svelte-kit/output/client/_app/error.svelte-7bf15e36.js                                            1.56 KiB / gzip: 0.75 KiB
.svelte-kit/output/client/_app/pages/docs/__layout@kit-docs.svelte-63e6c25f.js                     0.53 KiB / gzip: 0.35 KiB
.svelte-kit/output/client/_app/pages/docs/_...1_first-category/_...1_first-page.md-4bc77492.js     0.77 KiB / gzip: 0.48 KiB
.svelte-kit/output/client/_app/start-c57594a6.js                                                   26.72 KiB / gzip: 9.07 KiB
.svelte-kit/output/client/_app/pages/docs/_...1_first-category/_...2_second-page.md-6085f526.js    0.77 KiB / gzip: 0.48 KiB
.svelte-kit/output/client/_app/pages/docs/_...2_second-category/_...1_first-page.md-8301a3d7.js    0.77 KiB / gzip: 0.48 KiB
.svelte-kit/output/client/_app/pages/docs/_...2_second-category/_...2_second-page.md-478c23b9.js   0.77 KiB / gzip: 0.48 KiB
.svelte-kit/output/client/_app/pages/docs/index.svelte-72b18a38.js                                 0.26 KiB / gzip: 0.21 KiB
.svelte-kit/output/client/_app/chunks/singletons-f222faae.js                                       0.84 KiB / gzip: 0.51 KiB
.svelte-kit/output/client/_app/pages/index@kit-docs.md-bd06e500.js                                 15.35 KiB / gzip: 5.37 KiB
.svelte-kit/output/client/_app/chunks/contexts-e4888282.js                                         3.97 KiB / gzip: 1.77 KiB
.svelte-kit/output/client/_app/chunks/index-6303d0c3.js                                            10.46 KiB / gzip: 4.17 KiB
.svelte-kit/output/client/_app/chunks/scroll-88133740.js                                           2.00 KiB / gzip: 1.03 KiB
.svelte-kit/output/client/_app/assets/scroll-8521731d.css                                          0.03 KiB / gzip: 0.05 KiB
.svelte-kit/output/client/_app/assets/pages/__layout-kit-docs.svelte-7b5852ad.css                  46.28 KiB / gzip: 8.80 KiB
.svelte-kit/output/client/_app/pages/__layout-kit-docs.svelte-b66be7be.js                          84.67 KiB / gzip: 25.70 KiB
vite v2.9.9 building SSR bundle for production...
✓ 100 modules transformed.
Generated an empty chunk: "hooks"
.svelte-kit/output/server/manifest.json                                                      4.13 KiB
.svelte-kit/output/server/index.js                                                           75.17 KiB
.svelte-kit/output/server/entries/endpoints/kit-docs/_slug_.meta.json.js                     0.12 KiB
.svelte-kit/output/server/entries/endpoints/kit-docs/_dir_.sidebar.json.js                   0.13 KiB
.svelte-kit/output/server/entries/fallbacks/layout.svelte.js                                 0.24 KiB
.svelte-kit/output/server/entries/fallbacks/error.svelte.js                                  0.72 KiB
.svelte-kit/output/server/entries/pages/__layout-kit-docs.svelte.js                          49.35 KiB
.svelte-kit/output/server/entries/pages/docs/__layout@kit-docs.svelte.js                     0.26 KiB
.svelte-kit/output/server/entries/pages/docs/_...1_first-category/_...1_first-page.md.js     0.58 KiB
.svelte-kit/output/server/entries/pages/docs/_...1_first-category/_...2_second-page.md.js    0.58 KiB
.svelte-kit/output/server/entries/pages/docs/_...2_second-category/_...1_first-page.md.js    0.58 KiB
.svelte-kit/output/server/entries/pages/docs/_...2_second-category/_...2_second-page.md.js   0.58 KiB
.svelte-kit/output/server/entries/pages/docs/index.svelte.js                                 0.34 KiB
.svelte-kit/output/server/entries/pages/index@kit-docs.md.js                                 10.64 KiB
.svelte-kit/output/server/chunks/index-19808547.js                                           7.38 KiB
.svelte-kit/output/server/chunks/contexts-a5b02464.js                                        7.21 KiB
.svelte-kit/output/server/chunks/scroll-94143726.js                                          4.50 KiB
.svelte-kit/output/server/chunks/hooks-1c45ba0b.js                                           0.00 KiB
  307 /docs -> /docs/first-category/first-page
> 404 /docs/first-category/first-page" style="">                  Page Title                  </a>              </li><li class="first:mt-6"><a class="992:py-1.5 -ml-px flex items-center border-l-2 py-2 pl-4 hover:border-gray-inverse text-gray-soft hover:text-gray-inverse border-transparent font-normal" href="/docs/first-category/second-page" style="">                  Page Title                  </a>              </li><li class="first:mt-6"><a class="992:py-1.5 -ml-px flex items-center border-l-2 py-2 pl-4 hover:border-gray-inverse text-gray-soft hover:text-gray-inverse border-transparent font-normal" href="/docs/second-category/first-page" style="">                  Page Title                  </a>              </li><li class="first:mt-6"><a class="992:py-1.5 -ml-px flex items-center border-l-2 py-2 pl-4 hover:border-gray-inverse text-gray-soft hover:text-gray-inverse border-transparent font-normal" href="/docs/second-category/second-page" style="">                  Page Title                  </a>              </li></ul>        </li></ul>            </nav></aside><div class="992:hidden z-40"><div class="fixed top-0 left-0 bg-black/40 backdrop-blur-sm dark:bg-gray-700/80 transition-opacity duration-75 pointer-events-auto z-40 w-screen h-screen opacity-0 invisible"></div></div>    <main class="w-full overflow-x-hidden 992:min-h-[calc(100vh-var(--kd--navbar-height))] min-h-[calc(100vh-var(--kd--navbar-height))] px-8 992:px-16 pt-8" style="max-width: var(--kd-main-max-width, var(--kd-article-max-width));">      <article class="markdown prose dark:prose-invert z-10 max-w-[var(--kd-article-max-width)]">          <h1>Page Title</h1><p>Page description.</p></article>      <hr class="border-gray-divider mt-20">        <div class="992:text-xl flex items-center pt-12 pb-20 text-lg font-semibold text-gray-300">          <div class="ml-auto mb-4 flex flex-col items-end"><span class="text-gray-inverse mr-3 mb-4 inline-block">Next</span>                <a class="group transform-gpu text-lg font-medium transition-transform hover:scale-105 hover:text-gray-inverse" href="/docs/first-category/first-page" sveltekit:prefetch>    <span class="inline-block transform transition-transform duration-100 group-hover:translate-x-0 translate-x-2">Page Title</span>    <span class="opacity-0 transition-opacity duration-100 group-hover:visible group-hover:opacity-100 inline-block">-&gt;</span></a></div></div>      </main>    <div class="992:flex-1"></div>    </div></div><script type="module" data-sveltekit-hydrate="j7tozk">import { start } from "/_app/start-c57594a6.js";start({target: document.querySelector('[data-sveltekit-hydrate="j7tozk"]').parentNode,paths: {"base":"","assets":""},session: {},route: true,spa: false,trailing_slash: "never",hydrate: {status: 200,error: null,nodes: [import("/_app/pages/__layout-kit-docs.svelte-b66be7be.js"),import("/_app/pages/docs/__layout@kit-docs.svelte-63e6c25f.js"),import("/_app/pages/docs/_...1_first-category/_...1_first-page.md-4bc77492.js")],params: {"1":""},routeId: "docs/[...1]first-category/[...1]first-page"}});</script><script type="application/json" sveltekit:data-type="data" sveltekit:data-url="/kit-docs/docs_first-category_first-page.meta.json">{"status":200,"statusText":"","headers":{"content-type":"application/json; charset=utf-8"},"body":"{/"excerpt/":/"/",/"headers/":[],/"title/":/"Page Title/",/"description/":/"Page description./",/"frontmatter/":{/"title/":/"Page Title/",/"description/":/"Page description./"},/"lastUpdated/":1653269293192}"}</script><script type="application/json" sveltekit:data-type="data" sveltekit:data-url="/kit-docs/docs.sidebar.json">{"status":200,"statusText":"","headers":{"content-type":"application/json; charset=utf-8"},"body":"{/"links/":{/"./":[{/"title/":/"Page Title/",/"slug/":/"/docs////first-category////first-page/"},{/"title/":/"Page Title/",/"slug/":/"/docs////first-category////second-page/"},{/"title/":/"Page Title/",/"slug/":/"/docs////second-category////first-page/"},{/"title/":/"Page Title/",/"slug/":/"/docs////second-category////second-page/"}]}}"}</script></div></body></html> (linked from /docs/first-category/first-page)
    at file:///C:/Users/oneezy/Desktop/www/7.Testing/docs/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.338_svelte@3.48.0/node_modules/@sveltejs/kit/dist/chunks/index2.js:1037:11
    at save (file:///C:/Users/oneezy/Desktop/www/7.Testing/docs/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.338_svelte@3.48.0/node_modules/@sveltejs/kit/dist/chunks/index2.js:1257:4)
    at visit (file:///C:/Users/oneezy/Desktop/www/7.Testing/docs/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.338_svelte@3.48.0/node_modules/@sveltejs/kit/dist/chunks/index2.js:1148:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
 ELIFECYCLE  Command failed with exit code 1.
mihar-22 commented 2 years ago

That might be a SvelteKit issue because the 404 error contains the link href and a whole heap of other stuff: 404 /docs/first-category/first-page" style=""> ....

Mmm it might also be KitDocs poorly transforming the href on Windows. I can't say without debugging... but I can't debug this since I'm on Mac. I'd need some help. Here's the steps I'd take:

If nothing is found then probably look through the handlers and find any link/url potential transform issues there.

oneezy commented 2 years ago

Update with what's been tried so far:

+ 1. git clone git@github.com:svelteness/kit-docs.git
+ 2. pnpm i

PNPM v7.1.0 (attempt)

I then tried running

- pnpm dev

image

Then

- pnpm kit:build --filter kit-docs

image

. . .

PNPM v6.32.16 (downgrade attempt)

running pnpm dev this time produced different output with 500 Error code when going to http://localhost:3001

image

@mihar-22 says:

it's just the isLocalEnv test is failing so then this fails -> https://github.com/svelteness/kit-docs/blob/b7ae220a523e7cd1b601ce3112b9586f6979099e/packages/kit-docs/src/node/markdown-plugin/parser/parseMarkdown.ts#L21

It's resolving the path to @svelteness/kit-docs which won't work when running locally. it needs to point to $lib

Find out which of these lines are failing and add console.log statements and re-run pnpm dev -> https://github.com/svelteness/kit-docs/blob/b7ae220a523e7cd1b601ce3112b9586f6979099e/packages/kit-docs/src/node/utils/env.ts#L12-L14

I tried...

But still getting same results. Could be doing something wrong on my end.

#helpwanted