magidoc: [2.1.0] no such file or directory, lstat '/var/folders/xxxxx/T/carbon-multi-page@2.1.0/build'

After upgrading to 2.1.0 it throws this error:

✔ Determine tmp directories [0.0s]
✔ Select Package Manager [0.1s]
  › Selected pnpm
↓ Template already unzipped. [SKIPPED]
↓ Template already unzipped [SKIPPED]
✔ Install dependencies [0.6s]
✔ Resolving template configuration [0.0s]
  › Found 7 supported keys
    Target schema location: ./src/_schema.json
✔ Load GraphQL Schema [0.7s]
✔ Write variables file [0.0s]
✔ Build template [1s]
✖ Move output

------- Stacktrace -------
[Error: ENOENT: no such file or directory, lstat '/var/folders/yz/dk5dbx8n2hqcfk1kdktxmknh0000gn/T/carbon-multi-page@2.1.0/build'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/var/folders/yz/dk5dbx8n2hqcfk1kdktxmknh0000gn/T/carbon-multi-page@2.1.0/build'
}

I’m using node 14.9, latest pnpm and lib version 2.1.0.

It seems that Build Template step took 1s to finish while on v2.0.0 it took like a minute to finish.

edit: I totally removed the website.options.queryGenerationFactories, runned magidoc generate and it didn’t throw an error about missing scalars, it went directly to the error described above since the scalars check is happening during Build template step.

edit 2: I’ve manually created the build folder, runned magidoc generate, (the process was unexpectedly really fast), runned magidoc preview, visited localhost:4000 and the page was blank (as expected since the Build template step took only 1 sec to finish).

edit 3: don’t know if it matters but my global packages are installed in $HOME/.npm-global folder instead of npm default one so I won’t have to use sudo while installing global packages.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20

Most upvoted comments

2.13.1 version works perfect with vercel. Really appreciate your help and merging this fix.

Thank you a lot for the repro project. I managed to reproduce the issue and figure out what was the problem. Apparently, Svelte-kit seem to do something special when it detects it’s deployed on vercel, and it automatically outputs build files somewhere else than what is specified in the configuration… very weird and not very well documented feature.

I already opened and merged a bugfix for that (2.13.1), so thank you.

For the record, I managed to deploy your website here with a few tweaks

  • I needed to add a vercel.json file with the following content for URLs to be resolved.
{
    "cleanUrls": true
}

I will make sure to document that as part of the deployment documentation.

  • There was a typo in your index.html (anolist rather than anilist).

If you still face the issue with the latest version, feel free to re-open.

Thanks, I will have a look as soon as possible.

I will release a new version with the engine.node set, normally npm would give you an error if your try to install the cli using an invalid version.

I’ll add it to the docs as well. Thanks!

this is the issue with firebase and node 16 with monorepo, linking it here for visibility.

I actually tried using node 14 to develop locally, and svelte-kit, the engine used to create the website, forces node 16.7+. (See this line).

So unfortunately, I think it’s not even up to me, I don’t think i’ll be able to make it work under node 14. Although, i’m really surprised it worked yesterday to be honest, because version 2.0.0 with node 14 gives me the same error with 2.0.0.

Anyway, I hope you find a way to integrate it in your project eventually. We use it where I work, but It’s still an early project, and I want to gain more users like you to improve it even further. Thanks a lot for your contribution!


For the record, the issue seems to be un unhandled error in svelte-kit when using node 14

node:425300) UnhandledPromiseRejectionWarning: file:///tmp/carbon-multi-page@2.1.0/node_modules/@sveltejs/kit/dist/node/polyfills.js:11
import { webcrypto } from 'crypto';
         ^^^^^^^^^
SyntaxError: The requested module 'crypto' does not provide an export named 'webcrypto'