npm create cloudflare: "no such file or directory lstat"
When attempting to create a new project using
npm create cloudflare@latest
, I get the following error after choosing the options I wanted:
Not quite sure what to do from here... I recall being able to create a cloudflare project with react, like, last week, but now this is broken.19 Replies
note: creating that folder (
C:\Users\eslac\AppData\Roaming\
) does work... but... why does it need to exist? it shouldn't be necessary.
It ended up creating the project but finished with this
I dunno how to proceed here and I'm tired and annoyed, and this isn't a solid-start project like I wanted, so I'm going to let this go until tomorrow.@Dario is james in discord? if not, can you ping him internally
@jculveyhouse 🙂 👆
surprisingly I just run
npm create cloudflare@latest
and created a solidStart project without encountering either of the above issues 😕I'll also point out that this exact error/warning on two different machines - my home machine on Windows 10 + Node 20, and also my work machine which is Windows 11, but defaults to node 18.16.1
Ahhhhhhhh. This might explain it. Left is through
npm create cloudflare
, right is through npm create solid
. The difference is key. Fixing the missing unocss plugin makes it work.So, we had that one
npm
folder that doesn't exist in windows 10 (the first error didn't appear in windows 11), and we had that the missing vite plugin config. I got all the way to deploying, https://alterion-dev.pages.dev/ , works A-OK :AUthumbsup:Awesome! 😄 💪
what template are you using by the way? I guess the unoCSS issue should be fixed there? (the template I tried was the
basic
one and that doesn't seem to have this issue (since it does work on my machine! 😜))Yep, unocss was the template used. Sorry I thought it was actually showing in the log but I guess it didn't because that's the create-solid part not the cloudflare part?
yeah it probably didn't show up there because the one you shared it the build output which happens after create-(cloudflare/solid) did their job 🙂
yeah my bad on that one 😄
by the way I think I know what's going wrong there...
this is the generated config
I suspect that the unoCSS template contains the file in the correct way, then we update the config to include the
cloudflare-pages
preset and the rollup config (sorry I really can't remember if that's done by C3 or Solid itself... it's likely C3...), I bet that the problem is that the pre-existing config object is not merged with the new one, so we kind of drop the UnoCSS
plugin setting in the process...ok, C3 is the one doing the transformation: https://github.com/cloudflare/workers-sdk/blob/9a804b9061006f2c2d508151d86246400055e4fd/packages/create-cloudflare/templates/solid/c3.ts#L35-L56
GitHub
workers-sdk/packages/create-cloudflare/templates/solid/c3.ts at 9a8...
⛅️ Home to Wrangler, the CLI for Cloudflare Workers® - cloudflare/workers-sdk
as you can see we replace the
defineConfig
arguments instead of merging them....
sorry it's our bad then 😅👍if you want please open an issue in workers-sdk (https://github.com/cloudflare/workers-sdk/issues/new?assignees=&labels=bug&projects=&template=bug-template.yaml&title=%F0%9F%90%9B+BUG%3A) and I'll look into it when I can 🙂
(or if you prefer I can open the issue)
GitHub
Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
I wasn't sure if you were going to do it (and was afraid of forgetting this problem 😅), so I created the issue 🙂👍 https://github.com/cloudflare/workers-sdk/issues/5949
GitHub
🐛 C3 BUG: C3 drops potential existing arguments in the SolidStart c...
Which Cloudflare product(s) does this pertain to? C3 What version(s) of the tool(s) are you using? C3 2.13.0 What version of Node are you using? 20 What operating system and version are you using? ...
GitHub
[C3] fix: make sure that C3 doesn't delete pre-existing options in ...
What this PR solves / how to test
Fixes #5949
Author has addressed the following
Tests
TODO (before merge)
Included (except the e2e aspects which aren't actually currently tested in any way...