Skip to content

Creating a project with npm x create-tauri-app leaves description undefined, causes builds to fail #2508

Description

@edgex004

Describe the bug

Projects created with npm x create-tauri-app do not set a package.description in the the top-level Cargo.toml. This causes the Cargo.toml to fail being imported in cargo_tauri::interface::rust::get_workspace_dir in the call to CargoSettings::load(&dir);. This eventually leads to tauri build failing.

Additionally, the feedback to the developer as to why the build failure is happening is not particularly helpful. In my case, the failure to identify the workspace causes the rename of the built app from app to the final target name to fail due to incorrect path. The parse failure adds a context describing why parsing failed, which is silently consumed by rs.cli. This parse detail might be useful for the developer.

To Reproduce

Steps to reproduce the behavior:
1.

$ npm x create-tauri-app
We hope to help you create something special with Tauri!
You will have a choice of one of the UI frameworks supported by the greater web tech community.
This should get you started. See our docs at https://tauri.studio/
If you haven't already, please take a moment to setup your system.
You may find the requirements here: https://tauri.studio/en/docs/getting-started/setup-macos/
Press any key to continue...
? What is your app name? test-tauri-app
? What should the window title be? Test Tauri App
? What UI recipe would you like to add? Dominator (https://crates.io/crates/dominator/)
? Add "@tauri-apps/api" npm package? Yes
  1. cd test-tauri-app/
  2. yarn add -D wasm-pack
  3. yarn tauri build
  4. Note error:
Error: failed to rename `/Users/edgex004/Code/test-tauri-app/src-tauri/target/release/app` to `/Users/edgex004/Code/test-tauri-app/src-tauri/target/release/test-tauri-app`
  1. Add a package.description to test-tauri-app/Cargo.toml :
[package]
name = "test-tauri-app"
version = "1.0.0"
categories = ["wasm"]
edition = "2018"
description = ""
  1. yarn tauri build
  2. Build succeeds.

Expected behavior

Build succeeds without modifying test-tauri-app/Cargo.toml .

Screenshots

Platform and Versions (required):

yarn run v1.22.11
warning package.json: No license field
$ tauri info
 app:spawn Running "/Users/edgex004/Code/test-tauri-app/node_modules/@tauri-apps/cli/bin/tauri-cli tauri info" +0ms


Operating System - Mac OS, version 11.2.3 X64

Node.js environment
  Node.js - 16.7.0
  @tauri-apps/cli - 1.0.0-beta.7
  @tauri-apps/api - 1.0.0-beta.6

Global packages
  npm - 7.20.3
  yarn - 1.22.11

Rust environment
  rustc - 1.56.0-nightly
  cargo - 1.56.0-nightly

App directory structure
/dist
/target
/node_modules
/src-tauri
/src

App
  tauri.rs - 1.0.0-beta.6 (no lockfile)
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../dist
  devPath - http://localhost:10001/
  bundler - Rollup

✨  Done in 6.52s.

Additional context

Stack Trace

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions