cli icon indicating copy to clipboard operation
cli copied to clipboard

`dioxus create project-name` fails, error message counterintuitive or wrong

Open mgb-ingenuity opened this issue 2 years ago • 3 comments

Dioxus CLI currently has the following flow in the main README.md for creating a new project:

## Get Started 

Use `dioxus create project-name` to initialize a new Dioxus project. <br>

It will be cloned from the [dioxus-template](https://github.com/DioxusLabs/dioxus-template) repository.

<br>

Doing the following on my iMac, however, raises an error:

(base) MyDevice:dioxus mgb$ mkdir tests
(base) MyDevice:dioxus mgb$ cd tests
(base) MyDevice:tests mgb$ dioxus create foo
Error: Failed to load `dioxus.toml` because: Cargo Error: Failed to find the cargo directory

Shouldn't dioxus create be making the cargo directory in the first place? Additionally, isn't the toml config file Dioxus.toml, rather than (lowercase) dioxus.toml?

I've forked the repo and am willing to contribute changes to the documentation to make this clearer; seeking guidance from the main developers re: what the updates should be: mgbvox fork of dioxus cli

mgb-ingenuity avatar Jan 17 '23 14:01 mgb-ingenuity

This definitely seems like a bug. It is failing to load the dioxus config here: https://github.com/DioxusLabs/cli/blob/master/src/main.rs. I think that should be changed to either allow failing to load the config without panicing (and use the default config) or only load the config on some commands.

I think the only place the config is used there is load the plugins. I don't think the plugin system has any hooks for creating new packages, so we shouldn't even need to load it at all when running create (@mrxiaozhuox ?).

ealmloff avatar Jan 17 '23 21:01 ealmloff

@Demonthos @mrxiaozhuox PR up that fixed this on my end, if you care to take a look!

mgbvox avatar Jan 19 '23 17:01 mgbvox

@Demonthos @mrxiaozhuox PR up that fixed this on my end, if you care to take a look!

Merged, thank you!

mrxiaozhuox avatar Feb 16 '23 01:02 mrxiaozhuox