GithubHelp home page GithubHelp logo

tauri-apps / create-tauri-app Goto Github PK

View Code? Open in Web Editor NEW
889.0 889.0 80.0 4.88 MB

Rapidly scaffold out a new tauri app project.

License: Apache License 2.0

JavaScript 10.40% TypeScript 0.88% Rust 56.60% PowerShell 1.50% Shell 20.52% CSS 1.66% HTML 5.63% Svelte 1.03% Vue 1.77%

create-tauri-app's People

Contributors

amrbashir avatar beeb avatar birkskyum avatar btea avatar chippers avatar dependabot[bot] avatar escwxyz avatar fabianlars avatar github-actions[bot] avatar heyzooi avatar jbolda avatar jonaskruckenberg avatar krscott avatar lemarier avatar leon3s avatar lorenzolewis avatar lucasfernog avatar marc2332 avatar nklayman avatar nothingismagick avatar pewsheen avatar probablykasper avatar renovate[bot] avatar rstoenescu avatar soorya-u avatar tejasq avatar thadguidry avatar tomheaton avatar wildwestrom avatar xtekc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-tauri-app's Issues

Apps created with create-tauri-app with yew fail to compile

❯ yarn create tauri-app
yarn create v1.22.18
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-tauri-app
[###] 3/3
✔ Project name · tauri-app-yew
✔ Choose your package manager · cargo
✔ Choose your UI template · yew

Please follow https://tauri.app/v1/guides/getting-started/prerequisites to install the needed prerequisites, if you haven't already.
You also need to install tauri-cli (cargo install tauri-cli) and trunk (https://trunkrs.dev/#install)

Done, Now run:
  cd tauri-app-yew
  cargo tauri dev

✨  Done in 15.17s.

Then when compiling following error is shown:

cargo tauri dev
.... cut irrelevant information ...
   Compiling tauri-app-yew-ui v0.0.0 (/private/tmp/tauri-app-yew)
error[E0599]: no function or associated item named `from_serde` found for struct `wasm_bindgen::JsValue` in the current scope
  --> src/app.rs:40:34
   |
40 |                         JsValue::from_serde(&GreetArgs { name: &*name }).unwrap(),
   |                                  ^^^^^^^^^^ function or associated item not found in `wasm_bindgen::JsValue`
   |
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
1  | use gloo_utils::format::json::JsValueSerdeExt;
   |
help: there is an associated function with a similar name
   |
40 |                         JsValue::from_str(&GreetArgs { name: &*name }).unwrap(),
   |                                  ~~~~~~~~

For more information about this error, try `rustc --explain E0599`.
error: could not compile `tauri-app-yew-ui` due to previous error
2022-08-22T18:11:41.228453Z ERROR ❌ error
error from HTML pipeline

Caused by:
    0: error from asset pipeline
    1: error during cargo build execution
    2: cargo call returned a bad status

The reason is that there are missing features in the dependencies:

serde = { version = "1.0.140", features = ["derive"] }                                                                                                                   
wasm-bindgen = { version = "0.2.82", features = ["serde-serialize"] }

(I'll follow up with a PR)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate Limited

These updates are currently rate limited. Click on a checkbox below to force their creation now.

  • fix(deps): update rust crate dialoguer to 0.10.2
  • fix(deps): update rust crate serde to 1.0.144
  • fix(deps): update tauri monorepo (tauri, tauri-build)
  • chore(deps): update dependency vue-tsc to v0.40.1
  • fix(deps): update rust crate napi to 2.8.0
  • fix(deps): update rust crate napi-derive to 2.8.0
  • chore(deps): update actions/checkout action to v3

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
packages/cli/Cargo.toml
  • anyhow 1.0.62
  • dialoguer 0.10.1
  • pico-args 0.5.0
  • rust-embed 6.4.0
packages/cli/fragments/fragment-base/src-tauri/Cargo.toml
  • serde_json 1.0
  • serde 1.0
  • tauri 1.0.0
  • tauri-build 1.0.0
packages/cli/fragments/fragment-yew/Cargo.toml
  • js-sys 0.3.59
  • serde 1.0.140
  • wasm-bindgen 0.2.82
  • wasm-bindgen-futures 0.4.32
  • web-sys 0.3.59
  • yew 0.19
packages/cli/node/Cargo.toml
  • napi 2.6.3
  • napi-derive 2.6.0
  • napi-build 2.0.1
github-actions
.github/workflows/audit.yml
  • actions/checkout v2
  • actions-rs/audit-check v1
  • actions/checkout v2
  • pnpm/action-setup v2.2.2
  • actions/setup-node v3
.github/workflows/change-status-on-PR.yml
  • actions/checkout v2
.github/workflows/clippy.yml
  • actions/checkout v3
  • actions-rs/toolchain v1
  • actions-rs/clippy-check v1
.github/workflows/covector-version-or-publish.yml
  • actions/checkout v2
  • pnpm/action-setup v2.2.2
  • actions/setup-node v3
  • tauri-apps/create-pull-request v3.4.1
  • peter-evans/repository-dispatch v2
  • peter-evans/repository-dispatch v2
.github/workflows/deploy-scripts-worker.yml
  • actions/checkout v2
  • cloudflare/wrangler-action 2.0.0
.github/workflows/fmt.yml
  • actions/checkout v3
  • actions-rs/toolchain v1
  • actions-rs/cargo v1
  • actions/checkout v3
  • pnpm/action-setup v2.2.2
  • actions/setup-node v3
.github/workflows/publish-binaries.yml
  • actions/checkout v3
  • actions-rs/toolchain v1
  • actions-rs/cargo v1
  • actions/upload-artifact v3
  • actions/checkout v3
  • actions/download-artifact v3
  • xresloader/upload-to-github-release v1
.github/workflows/publish-napi.yml
  • actions/checkout v3
  • pnpm/action-setup v2.2.2
  • actions/setup-node v3
  • actions-rs/toolchain v1
  • Swatinem/rust-cache v1
  • actions/cache v3
  • addnab/docker-run-action v3
  • actions/upload-artifact v3
  • actions/checkout v3
  • pnpm/action-setup v2.2.2
  • actions/setup-node v3
  • actions/cache v3
  • actions/download-artifact v3
.github/workflows/test.yml
  • actions/checkout v2
  • actions-rs/toolchain v1
  • actions-rs/cargo v1
npm
package.json
  • prettier 2.7.1
  • covector 0.7.3
  • undici >=5.8.2
packages/cli/fragments/fragment-react-ts/package.json
  • react ^18.2.0
  • react-dom ^18.2.0
  • @tauri-apps/api ^1.0.2
  • @types/react ^18.0.15
  • @types/react-dom ^18.0.6
  • @vitejs/plugin-react ^2.0.0
  • typescript ^4.6.4
  • vite ^3.0.2
  • @tauri-apps/cli ^1.0.5
packages/cli/fragments/fragment-react/package.json
  • react ^18.2.0
  • react-dom ^18.2.0
  • @tauri-apps/api ^1.0.0
  • @types/react ^18.0.15
  • @types/react-dom ^18.0.6
  • @vitejs/plugin-react ^2.0.0
  • vite ^3.0.2
  • @tauri-apps/cli ^1.0.0
packages/cli/fragments/fragment-solid-ts/package.json
  • solid-js ^1.4.7
  • @tauri-apps/api ^1.0.0
  • typescript ^4.7.4
  • vite ^3.0.0
  • vite-plugin-solid ^2.3.0
  • @tauri-apps/cli ^1.0.0
packages/cli/fragments/fragment-solid/package.json
  • solid-js ^1.4.7
  • @tauri-apps/api ^1.0.0
  • vite ^3.0.0
  • vite-plugin-solid ^2.3.0
  • @tauri-apps/cli ^1.0.0
packages/cli/fragments/fragment-svelte-ts/package.json
  • @tauri-apps/api ^1.0.2
  • @sveltejs/vite-plugin-svelte ^1.0.1
  • @tsconfig/svelte ^3.0.0
  • svelte ^3.49.0
  • svelte-check ^2.8.0
  • svelte-preprocess ^4.10.7
  • tslib ^2.4.0
  • typescript ^4.6.4
  • vite ^3.0.2
  • @tauri-apps/cli ^1.0.5
packages/cli/fragments/fragment-svelte/package.json
  • @tauri-apps/api ^1.0.2
  • @sveltejs/vite-plugin-svelte ^1.0.1
  • svelte ^3.49.0
  • vite ^3.0.2
  • @tauri-apps/cli ^1.0.5
packages/cli/fragments/fragment-vue-ts/package.json
  • vue ^3.2.37
  • @tauri-apps/api ^1.0.2
  • @vitejs/plugin-vue ^3.0.1
  • typescript ^4.6.4
  • vite ^3.0.2
  • vue-tsc ^0.39.0
  • @tauri-apps/cli ^1.0.5
packages/cli/fragments/fragment-vue/package.json
  • vue ^3.2.37
  • @tauri-apps/api ^1.0.2
  • @vitejs/plugin-vue ^3.0.1
  • vite ^3.0.2
  • @tauri-apps/cli ^1.0.5
packages/cli/node/npm/darwin-arm64/package.json
  • node >= 10
packages/cli/node/npm/darwin-x64/package.json
  • node >= 10
packages/cli/node/npm/linux-arm-gnueabihf/package.json
  • node >= 10
packages/cli/node/npm/linux-arm64-gnu/package.json
  • node >= 10
packages/cli/node/npm/linux-arm64-musl/package.json
  • node >= 10
packages/cli/node/npm/linux-x64-gnu/package.json
  • node >= 10
packages/cli/node/npm/linux-x64-musl/package.json
  • node >= 10
packages/cli/node/npm/win32-ia32-msvc/package.json
  • node >= 10
packages/cli/node/npm/win32-x64-msvc/package.json
  • node >= 10
packages/cli/node/package.json
  • @napi-rs/cli 2.11.0
  • node >= 10
packages/worker/package.json
  • wrangler 2.0.24

  • Check this box to trigger a request for Renovate to run again on this repository

@latest doesn't work for yarn

In commit d462775, @latest was added to the create subcommands for each package manager. This works with npm, but doesn't work for yarn, and instead causes the following error:

/bin/sh: line 1: /home/user/.yarn/bin/create-vite@latest: No such file or directory
error Command failed.

update tauri 1.2.0 template

When I tried to execute yarn create tauri-app, the version of tauri is 1.1.1. The 1.2.0 is released, maybe we should update the templates.

[bug] create new tauri project in windows env failed with windows account name space

Describe the bug

PS C:\WorkSpace> yarn create tauri-app
yarn create v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-tauri-app
'C:\Users\My' is not recognized as an internal or external command,
operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\My Username\AppData\Local\Yarn\bin\create-tauri-app
Arguments:
Directory: C:\WorkSpace
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
PS C:\WorkSpace>

Reproduction

No response

Expected behavior

No response

Platform and versions

windows 11
yarn create v1.22.19
[email protected]

Stack trace

No response

Additional context

No response

Include additional steps for yew template

When using CTA with the yew template, a couple additional steps are missing from the post-setup instructions. Currently, it gives the following output:

Done, Now run:
  cd a
  cargo tauri dev

Suggested change to include yew's documented prerequisite steps:

Done, Now run:
  cd a
  cargo install trunk
  rustup target add wasm32-unknown-unknown
  cargo tauri dev

Or, a note to complete those steps if not already done or a link can be included to the aforementioned prerequisites steps.

This would be beneficial to prevent confusion with new users.

[Bug Report]: Cannot scaffold an app with vite using create-vite

I'm not able to scaffold a Svelte-TS app with vite using the create-tauri cli app.

Steps to reproduce:

  1. Run yarn create tauri-app
  2. Answer configuration questions:
? What is your app name? tauri-app
? What should the window title be? Tauri App
? What UI recipe would you like to add? **create-vite** (vanilla, vue, react, 
svelte, preact, lit) 
(https://vitejs.dev/guide/#scaffolding-your-first-vite-project)
? Add "@tauri-apps/api" npm package? Yes
? Which vite template would you like to use? **svelte-ts**
  1. cd tauri-app
  2. yarn tauri dev
  3. Tauri window opens, but throws the following error: SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.

Software versions:

  • yarn: 1.22.19
  • @tauri-apps/cli: 1.0.5
  • create-tauri-app: 1.0.2

Missing icon.icns in template

When building an unmodified project generated using create-tauri-app, it fails with:

Error failed to bundle project: Failed to build data folders and files:
Failed to build data folders and files: Failed to create icon files:
Failed to create icon files: path matching icons/icon.icns not found.:
path matching icons/icon.icns not found.
error Command failed with exit code 1.

That's because the default src-tauri/tauri.conf.json includes

      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/[email protected]",
        "icons/icon.icns",
        "icons/icon.ico"
      ]

and icon.icns is not in the list of currently provided icons.

Is it on purpose, e.g. because the icon.icns file included in tauri is pretty large (1.17 MB)?

Anyway, I think we should use one of these options:

  1. Include the icon.icns file included in tauri (1.17 MB)
  2. Or include a lighter icon.icns file
  3. Or remove icon.icns from default src-tauri/tauri.conf.json.

What do you prefer?

[bug] trunk serve causes cargo tauri to rebuild which causes trunk serve to rebuild

Describe the bug

If I run cargo tauri dev and trunk serve at the same time, they both watch the same folder for changes, and detect changes to temporary files from the other tool's build, so they both endlessly keep triggering rebuilds.

OTOH If I don't run trunk serve myself, then cargo tauri dev is stuck waiting forever:

Warn Waiting for your frontend dev server to start on http://localhost:1420/...
Warn Waiting for your frontend dev server to start on http://localhost:1420/...
Warn Waiting for your frontend dev server to start on http://localhost:1420/...

Also, when these projects rebuild, they rebuild almost from scratch. I think it's because both end up using the same target/ folder and overwrite each other's build artifacts due to differences in cargo feature flags they use.

Reproduction

npm create tauri-app
# choose cargo and yew
cd the-app
cargo tauri dev 

and then run

trunk serve

in another terminal in the same dir.

Expected behavior

Ideally cargo tauri dev should start the server, so that a separate trunk command is not needed.

Platform and versions

Environment
› OS: Mac OS 12.5.1 X64
› Node.js: 18.8.0
› npm: 8.18.0
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.63.0
› cargo: 1.63.0
› Rust toolchain: stable-aarch64-apple-darwin

Packages
WARNING: no lock files found, defaulting to npm
› @tauri-apps/cli [NPM]: 1.0.5
› @tauri-apps/api [NPM]: Not installed!
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,

App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
package.json not found

App directory structure
├─ dist
├─ target
├─ public
├─ src-tauri
├─ .vscode
└─ src

Stack trace

No response

Additional context

No response

[Angular CLI] Reintroduce Angular CLI UI Recipe

In v1 of create-tauri-app, there used to be a UI recipe for generating an Angular project, which was quite useful.
v2 however does not seem to have it anymore.

I would love to see it come back!

error when trying to create app with cargo

I enter cargo create-tauri-app

fill in the questions and after selecting the UI template I get this error:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/alireza/.cargo/registry/src/github.com-1ecc6299db9ec823/create-tauri-app-2.6.3/src/template.rs:209:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:48:5
   3: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
   4: create_tauri_app::template::Template::render
   5: create_tauri_app::run
   6: cargo_create_tauri_app::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

[bug]: Unknown Syntax Error: Unsupported option name ("--ignore-scripts").

Describe the bug

yarn create tauri-app
windows10

Reproduction

yarn create tauri-app
windows10

Expected behavior

No response

Platform and versions

Missing script: "tauri"

Stack trace

No response

Additional context

yarn create tauri-app
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 14s 982ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 526ms
➤ YN0000: Done in 15s 742ms

? What is your app name? test0
? What should the window title be? test0
? Would you like to add a UI recipe? Vanilla.js
===== running initial command(s) =====
===== installing any additional needed deps =====
Installing @tauri-apps/cli...
Unknown Syntax Error: Unsupported option name ("--ignore-scripts").

$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
Error with command: yarn
Error: Error: Command failed with exit code 1: yarn add --dev --ignore-scripts @tauri-apps/cli
at C:\Users\user\AppData\Local\Yarn\Berry\cache\create-tauri-app-npm-1.0.0-beta-rc.4-90c8c4d827-8.zip\node_modules\create-tauri-app\dist\index.js:59:15
at Generator.throw ()
at rejected (C:\Users\user\AppData\Local\Yarn\Berry\cache\create-tauri-app-npm-1.0.0-beta-rc.4-90c8c4d827-8.zip\node_modules\create-tauri-app\dist\index.js:36:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

[feat] Vanilla.js template in create-tauri-app should use JS and CSS

Describe the problem

crate-tauri-app has an option to create "Vanilla.js (html, css, and js without the bundlers)" app. However, it creates only the HTML part of it, but doesn't include any CSS or JS.

I don't know where to put JS. If there are no bundles, how does it get bundled into the final native application? I don't know if I can just create foo.js anywhere and reference it through a <script> in dist/index.html. Does it require any special path, syntax? There is an overwhelming amount of configuration in Tauri, and I'm afraid I need to add some "myJavaScriptIsHere":"./js/" to tauri.conf.json. Even if I don't need to, I'd rather have a proof of that in the form of a working JS example in the app template.

Describe the solution you'd like

I'd like the template in crate-tauri-app contain JS and CSS files too, so that it's clear how configuration for more than just a single HTML file works, and what is the preferred syntax for these things.

Alternatives considered

I've tried putting JS directly in the dist/index.html like this:

  <script type="module">
    import { listen } from '@tauri-apps/api/event'
  </script>

and it fails with a runtime error:

TypeError: Module specifier, '@tauri-apps/api/event' does not start with "/", "./", or "../". Referenced from tauri://localhost

so I'm not sure if it's even possible to use Tauri's API at all from the Vanilla template. An example with working JS using these imports successfully would be greatly appreciated.

Additional context

There is an overwhelming amount of configuration in Tauri. The configuration-over-convention approach is opposite of Rust's philosophy, and it's a barrier for me, because it's not easy to look at other Tauri apps to learn from — they're all different and incompatible due to having their snowflake configuration.

[bug] yarn create tauri-app

Describe the bug

I was trying to run a tauri app using the following command and I'm using yarn version 3.2.1

yarn create tauri-app

Reproduction

yarn create tauri-app

Expected behavior

Please see the Stack trace section.

Platform and versions

cargo tauri info

Output

Environment
  › OS: Mac OS 11.5.2 X64
  › Node.js: 18.4.0
  › npm: 8.12.1
  › pnpm: Not installed!
  › yarn: 3.2.1
  › rustup: 1.24.3
  › rustc: 1.61.0
  › cargo: 1.61.0
  › Rust toolchain: stable-aarch64-apple-darwin

Packages
  › @tauri-apps/cli [NPM]: 1.0.0

Stack trace

yarn create tauri-app
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 2s 75ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done in 2s 218ms


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 tool should get you quickly 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/v1/guides/getting-started/prerequisites

Press any key to continue...
? What is your app name? test-app
? What should the window title be? test-app
? What UI recipe would you like to add? create-react-app
(https://create-react-app.dev/)
? Add "@tauri-apps/api" npm package? Yes
? Which create-react-app template would you like to use? create-react-app
(Typescript)
>> Running initial command(s)
➤ YN0000: ┌ Resolution step
➤ YN0061: │ tar@npm:2.2.2 is deprecated: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
➤ YN0000: └ Completed in 2s 36ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 2s 149ms


Creating a new React app in /Users/bob/Desktop/tauri/test-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-typescript...

Usage Error: The nearest package directory (/Users/bob/Desktop/tauri/test-app) doesn't seem to be part of the project declared in /Users/bob.

- If /Users/bob isn't intended to be a project, remove any yarn.lock and/or package.json file there.
- If /Users/bob is intended to be a project, it might be that you forgot to list Desktop/tauri/test-app in its workspace configuration.
- Finally, if /Users/bob is fine and you intend Desktop/tauri/test-app to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.

$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts cra-template-typescript --cwd /Users/bob/Desktop/tauri/test-app has failed.

Deleting generated file... package.json
Deleting test-app/ from /Users/bob/Desktop/tauri
Done.
Error with command: yarn
Error: Error: Command failed with exit code 1: yarn create react-app test-app --template typescript
    at /Users/bob/.yarn/berry/cache/create-tauri-app-npm-1.0.0-rc.5-61508c3233-8.zip/node_modules/create-tauri-app/dist/index.js:146:15
    at Generator.throw (<anonymous>)
    at rejected (/Users/bob/.yarn/berry/cache/create-tauri-app-npm-1.0.0-rc.5-61508c3233-8.zip/node_modules/create-tauri-app/dist/index.js:38:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Additional context

No response

Pressing CAPS LOCK or CTRL cause prompts to crash

PS C:\Users\toast\workspace> pnpm create tauri-app
.../Local/pnpm/store/v3/tmp/dlx-47960    |   +2 +
Packages are copied from the content-addressable store to the virtual store.
  Content-addressable store is at: C:\Users\toast\AppData\Local\pnpm\store\v3
  Virtual store is at:             ../AppData/Local/pnpm/store/v3/tmp/dlx-47960/node_modules/.pnpm
.../Local/pnpm/store/v3/tmp/dlx-47960    | Progress: resolved 10, reused 2, downloaded 0, added 2, done

? Project name (tauri-app) › thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: NotConnected, error: "Not a terminal" }', D:\a\create-tauri-app\create-tauri-app\packages\cli\src\lib.rs:71:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR  Command failed with exit code 3221226505: C:\Users\toast\AppData\Local\pnpm\store\v3\tmp\dlx-47960\node_modules\.bin\create-tauri-app.CMD

pnpm: Command failed with exit code 3221226505: C:\Users\toast\AppData\Local\pnpm\store\v3\tmp\dlx-47960\node_modules\.bin\create-tauri-app.CMD
    at makeError (C:\Users\toast\scoop\persist\nodejs-lts\bin\node_modules\pnpm\dist\pnpm.cjs:22289:17)
    at handlePromise (C:\Users\toast\scoop\persist\nodejs-lts\bin\node_modules\pnpm\dist\pnpm.cjs:22860:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.handler (C:\Users\toast\scoop\persist\nodejs-lts\bin\node_modules\pnpm\dist\pnpm.cjs:199043:7)
    at async C:\Users\toast\scoop\persist\nodejs-lts\bin\node_modules\pnpm\dist\pnpm.cjs:206407:21
    at async run (C:\Users\toast\scoop\persist\nodejs-lts\bin\node_modules\pnpm\dist\pnpm.cjs:206378:34)
    at async runPnpm (C:\Users\toast\scoop\persist\nodejs-lts\bin\node_modules\pnpm\dist\pnpm.cjs:206599:5)
    at async C:\Users\toast\scoop\persist\nodejs-lts\bin\node_modules\pnpm\dist\pnpm.cjs:206591:7

create-tauri-app multiple templates are broken

Link to discord discussion: https://discord.com/channels/616186924390023171/1051492348707741787

problem description: not much to say, other than I try to create a tauri app using this tool. So far, Ive tried react, react-js, vue templates with the same problem(compiled program shows blank window).

commands that i run:

cargo create-tauri-app
 (choose package manager: npm)
npm install
npm run tauri dev

No errors are produced. Opening dev tools -> JS console always shows an error , different in each project type(see discord thread link for examples)

All prerequisits from https://tauri.app/v1/guides/getting-started/prerequisites are installed. I didnt install pnpm or yarn, since they are alternatives to npm

cargo create-tauri-app --version outputs 2.7.2

Example of the problem, using Vue
grafik

Tauri info output:
grafik

create-tauri-app for sveltekit is broken

yarn create tauri-app with sveltekit or sveltekit-ts are both failing currently after running yarn install && yarn dev on linux

I believe this may be related to this vite issue with mismatched plugin and vite v4.0.0.

The yarn create tauri-app for svelte and svelte-ts are both still working. I think this may be fixed by pinning dependency or updating vite/sveltekit dependencies.

$ yarn dev
yarn run v1.22.19
$ vite dev
failed to load config from /vite.config.js
error when starting dev server:
file://node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:6
import { isCSSRequest } from 'vite';
         ^^^^^^^^^^^^
SyntaxError: The requested module 'vite' does not provide an export named 'isCSSRequest'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:533:24)

[bug] react-ts port is setup wrong

Describe the bug

yarn and npm not starting frontend dev server. I followed the quick start with both npm and yarn and got the same result on Ubuntu 20.04.1

Warning
Warn Waiting for your frontend dev server to start on http://localhost:7000/...

Frontend server not starting

Reproduction

  1. Setup Linux env per the tauri app instructions
  2. install packages with yarn or npm
  3. run yarn tauri dev or npm run run tauri dev

Expected behavior

Application starts both the server and frontend server

Platform and versions

Environment

› OS: Ubuntu 22.04 X64

› Node.js: 16.16.0

› npm: 8.11.0

› pnpm: Not installed!

› yarn: 1.22.19

› rustup: 1.25.1

› rustc: 1.63.0

› cargo: 1.63.0

› Rust toolchain: stable-x86_64-unknown-linux-gnu

Packages

› @tauri-apps/cli [NPM]: 1.0.5

› @tauri-apps/api [NPM]: 1.0.2

› tauri [RUST]: 1.0.5,

› tauri-build [RUST]: 1.0.4,

› tao [RUST]: 0.12.2,

› wry [RUST]: 0.19.0,

App

› build-type: bundle

› CSP: unset

› distDir: ../dist

› devPath: http://localhost:7000/

› framework: React

App directory structure

├─ .vscode

├─ public

├─ node_modules

├─ src

└─ src-tauri

Stack trace

yarn run v1.22.19
$ tauri dev
     Running BeforeDevCommand (`yarn dev`)
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
$ vite

  VITE v3.0.9  ready in 291 ms

  ➜  Local:   http://localhost:1420/
  ➜  Network: use --host to expose
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
        Warn Waiting for your frontend dev server to start on http://localhost:7000/...
       Error Could not connect to `http://localhost:7000/` after 180s. Please make sure that is the URL to your dev server.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional context

Thanks for taking a look at this

[bug] Error while created by pnpm.

Describe the bug

An error occurred while creating creating a project.

Reproduction

pnpm create tauri-app

Platform and versions

OS: Windows 10 x64
Node.js: 16.16.0
npm: 8.11.0
pnpm: 7.6.0
rustup: 1.24.3
rustc: 1.60.0
cargo: 1.60.0
Rust toolchain: stable-x86_64-pc-windows-msvc

Stack trace

ERROR  Error: command failed: pnpm install --reporter silent --shamefully-hoist
Error: command failed: pnpm install --reporter silent --shamefully-hoist
    at ChildProcess.<anonymous> (D:\npm\cache\_npx\18fcca21cf4d8fd7\node_modules\@vue\cli\lib\util\executeCommand.js:138:16)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess.cp.emit (D:\npm\cache\_npx\18fcca21cf4d8fd7\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Error with command: npx
Error: Error: Command failed with exit code 1: npx @vue/cli@latest create test -m pnpm
    at D:\pnpm\store\v3\tmp\dlx-1268\node_modules\.pnpm\[email protected]\node_modules\create-tauri-app\dist\index.js:146:15
    at Generator.throw (<anonymous>)
    at rejected (D:\pnpm\store\v3\tmp\dlx-1268\node_modules\.pnpm\[email protected]\node_modules\create-tauri-app\dist\index.js:38:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Additional context

Based on the error message (in Stack trace), I can roughly guess the cause of the error: According to the error message, "npx @vue/cli" was executed during the creation process, but my "@vue/cli" was installed in pnpm instead of npm. That's what led to the mistake.

[bug] error when running tutorial: module not found

Describe the bug

error when running tutorial (https://tauri.studio/docs/getting-started/beginning-tutorial)

Reproduction

npx create-tauri-app
# choose vite
# choose vue-ts

Expected behavior

No response

Platform and versions

Operating System - Mac OS, version 12.1.0 X64

Node.js environment
  Node.js - 14.15.1
  @tauri-apps/cli - 1.0.0-rc.5
  @tauri-apps/api - 1.0.0-rc.1

Global packages
  npm - 6.14.8
  pnpm - 6.21.0
  yarn - Not installed

Rust environment
  rustup - 1.24.3
  rustc - 1.58.1
  cargo - 1.58.0
  toolchain - stable-x86_64-apple-darwin 

App directory structure
/node_modules
/public
/src-tauri
/.vscode
/src

App
  tauri - 1.0.0-rc.3 (no lockfile)
  tauri-build - no manifest (no lockfile)
  tao - no manifest (no lockfile)
  wry - no manifest (no lockfile)
  build-type - bundle
  CSP - unset
  distDir - ../dist
  devPath - http://localhost:3000/
  framework - Vue.js

Stack trace

>> Updating "package.json"
>> Running "tauri init"

> [email protected] tauri /Users/alston/work/tauri-app
> tauri "init" "--app-name" "tauri-app" "--window-title" "Tauri App" "--dist-dir" "../dist" "--dev-path" "http://localhost:3000" "--ci"

>> Updating "tauri.conf.json"
>> Running final command(s)
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/Users/alston/work/tauri-app/node_modules/esbuild/install.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Error with command: node
Error: Error: Command failed with exit code 1: node ./node_modules/esbuild/install.js
    at /Users/alston/.npm/_npx/10370/lib/node_modules/create-tauri-app/dist/index.js:62:15
    at Generator.throw (<anonymous>)
    at rejected (/Users/alston/.npm/_npx/10370/lib/node_modules/create-tauri-app/dist/index.js:39:65)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)


### Additional context

_No response_

Add @tauri-apps/cli to devDependencies

Starting from scratch (options listed below):

$ npm create tauri-app
# ? What is your app name? SheetJSTauri
# ? What should the window title be? SheetJS + Tauri
# ? What UI recipe would you like to add? create-vite 
# ? Add "@tauri-apps/api" npm package? Yes
# ? Which vite template would you like to use? vue-ts
# ...
$ cd SheetJSTauri
$ npm run tauri

This prints some output.

Now try installing a module:

$ npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
$ npm run tauri

> [email protected] tauri
> tauri

sh: tauri: command not found

This happens because npm thinks the CLI tool is extraneous and wipes it when you try to install a dependency, even if you choose to add @tauri-apps/api. If you start from scratch and run npm ls, you can clearly see the state:

$ npm ls
[email protected] /private/tmp/SheetJSTauri
├── @tauri-apps/[email protected] extraneous
├── @tauri-apps/[email protected] extraneous

The fix is for the scaffold to add @tauri-apps/cli in devDependencies

Error Using Git Bash under Windows

Perhaps a bit of an odd combo but I hit an error when running under git bash on Windows:

TypeError: process.stdin.setRawMode is not a function
    at C:\Users\JamesMcNally\AppData\Local\npm-cache\_npx\b58944764482de26\node_modules\create-tauri-app\dist\index.js:667:19
    at Generator.next (<anonymous>)
    at C:\Users\JamesMcNally\AppData\Local\npm-cache\_npx\b58944764482de26\node_modules\create-tauri-app\dist\index.js:40:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\JamesMcNally\AppData\Local\npm-cache\_npx\b58944764482de26\node_modules\create-tauri-app\dist\index.js:36:12)
    at keypress (C:\Users\JamesMcNally\AppData\Local\npm-cache\_npx\b58944764482de26\node_modules\create-tauri-app\dist\index.js:664:28)
    at C:\Users\JamesMcNally\AppData\Local\npm-cache\_npx\b58944764482de26\node_modules\create-tauri-app\dist\index.js:692:11
    at Generator.next (<anonymous>)
    at C:\Users\JamesMcNally\AppData\Local\npm-cache\_npx\b58944764482de26\node_modules\create-tauri-app\dist\index.js:40:71
    at new Promise (<anonymous>)

I presume this relates to this line:

process.stdin.setRawMode(true);

When I run under the Windows command line it runs without the error.

Versions:

Git bash: 2.37.1
Node: 16.16.0

[bug] create-tauri-app caused error via pnpm with vite

Describe the bug

If use create-tauri-app package to create vue app via pnpm with create-vite, it will returns a error message insteads of create package use vite template.

Reproduction

pnpm create tauri-app

and choose create-vite (vanilla, vue, react, svelte, preact, lit) (https://vitejs.dev/guide /#scaffolding-your-first-vite-project)

then choose vue-ts

it will returns:

 ERROR   ERROR  Unknown option: 'template'
Did you mean 'test-pattern'? Use "--config.unknown=value" to force an unknown option.
For help, run: pnpm help create
Error with command: pnpm
Error: Error: Command failed with exit code 1: pnpm create vite tauri-app --template vue-ts
    at C:\Users\kiochan\AppData\Local\Temp\dlx-23528\5\node_modules\.pnpm\[email protected]\node_modules\create-tauri-app\dist\index.js:62:15
    at Generator.throw (<anonymous>)
    at rejected (C:\Users\kiochan\AppData\Local\Temp\dlx-23528\5\node_modules\.pnpm\[email protected]\node_modules\create-tauri-app\dist\index.js:39:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Expected behavior

It should create package with command:

pnpm create vite tauri-app -- --template vue-ts

insteads of

pnpm create vite tauri-app --template vue-ts

Platform and versions

Operating System - Windows, version 10.0.19044 X64
Webview2 - 98.0.1108.56
Visual Studio Build Tools - Not installed
WARNING: no lock files found, defaulting to npm

Node.js environment
  Node.js - 16.5.0
  @tauri-apps/cli - 1.0.0-rc.5
  @tauri-apps/api - Not installed

Global packages
  npm - 7.19.1
  pnpm - 6.31.0
  yarn - 1.22.10

Rust environment
  rustup - 1.24.3
  rustc - 1.58.1
  cargo - 1.58.0
  toolchain - stable-x86_64-pc-windows-gnu

App directory structure
/tauri-app

App

Stack trace

No response

Additional context

No response

Add Yew to recipes

Add Yew minimal frontend using trunk and/or wasm-pack to the recipes of the CLI.

yew-trunk-minimal-template
https://github.com/yewstack/yew-trunk-minimal-template

yew-wasm-pack-minimal
https://github.com/yewstack/yew-wasm-pack-minimal



or even a full wasm-pack template
https://github.com/yewstack/yew-wasm-pack-template

Allow setting install dir

I'd expect an option on which directory to initialise the app into. Normally this would be be into a dir name I specify in step 2 below, but I may want to do it in the current directory (.) or another instead.

Reproduction:

  1. Run yarn create tauri-app
  2. Enter my app name ("reframe")
  3. Enter the window title ("Reframe")
  4. Choose Svelte
  5. Y to add tauri-apps/api
  6. Y for typescript

v2.6.4 install error

cargo instal create-tauri-app

error occurs:

❯ cargo install create-tauri-app
    Updating `rsproxy` index
  Installing create-tauri-app v2.6.4
error: failed to compile `create-tauri-app v2.6.4`, intermediate artifacts can be found at `/var/folders/4s/pzpdwjzx149576lzq351p12m0000gn/T/cargo-installQHq4Jt`

Caused by:
  failed to select a version for the requirement `rust-embed = "^6.5"`
  candidate versions found which didn't match: 6.4.2, 6.4.1, 6.4.0, ...
  location searched: `rsproxy` index (which is replacing registry `crates-io`)
  required by package `create-tauri-app v2.6.4`
  perhaps a crate was updated and forgotten to be re-vendored?

[feat] Support for custom recipes

Describe the problem

I love how tauri supports so many recipes out-of-the-box. However, over time, I've built up a bunch of my own create-* packages that I would love to initialize my Tauri app with. Most of these extend existing templates (e.g. packages and configs on top of create-vite).

Describe the solution you'd like

Looking at the svelte merge, it looks like there's some custom, tauri-specific config that's required on top of the create-* package. Is it possible to extend existing recipes in some way?

Alternatives considered

Currently, I initialize a new tauri app and then go about installing packages and configs from my custom templates.

Additional context

No response

Not working with yarn classic

Hi, I'm getting an error:

Error failed to get project out directory: failed to get cargo metadata: No such file or directory (os error 2)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce - just run

yarn create tauri-app
  select react-ts
yarn
yarn tauri dev

Is there any step required that is not mentioned in the docs?

My versions:

  • node v16.17.1
  • yarn 1.22.19
  • MacOS 11.6

[bug] `yarn create tauri-app` not working if you have spaces in username

Describe the bug

Running the command produced the following output:

PS C:\js> yarn create tauri-app
yarn create v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-tauri-app
Der Befehl "C:\Users\Simon" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
error Command failed.
Exit code: 1
Command: C:\Users\Simon Flick\AppData\Local\Yarn\bin\create-tauri-app
Arguments:
Directory: C:\js
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

It worked when I ran the command manually and escaped my username:
C:\Users\"Simon Flick"\AppData\Local\Yarn\bin\create-tauri-app

Reproduction

No response

Expected behavior

No response

Platform and versions

Windows 10

Stack trace

No response

Additional context

No response

RFC: create-tauri-app Rewrite

The purpose of the create-tauri-app rebuild is to create a single entry-point for any user coming from any background or project setup and enable them to quickly get started with Tauri.

This should be implemented in a way that can run on any system without dependencies (i.e. Node, Rust) being setup and with the goal of including the work @chippers is working on around prerequisites.

Note: This is currently just in the stage where we request comments on the USER FLOW. The actual technical implementations and details can be hashed out during development.


Personas

These are the different types of users and the paths they could take when getting started with Tauri.

Benny: New Node Project User

  • Familiar with Node
  • Wants to stay in the Node ecosystem/tooling

Jannett: New Rust Project User

  • Familiar with Cargo/Rust
  • Wants to stay in the Rust ecosystem/tooling

Jose: New to Both Ecosystems

  • "I don't have a preference on which tool I use"
  • Could be new to development or coming from a Java or similar background

Matéo: Existing Node Project User

  • Already has a Node project setup and just wants to add Tauri to it

Ginevra: Existing Rust Project User

  • Already has a Rust project setup and just wants to add Tauri to it

Flows

Benny: New Node Project User

  1. npm create tauri-app
    • Executes a native node add-on, similar to how we do with @tauri-apps/cli (thanks, Amr!)
  2. Skip forward to Common Flow...

Jannett: New Rust Project User

  1. cargo install create-tauri-app
    • Builds create-tauri-app binary
  2. Execute cargo create-tauri-app or create-tauri-app
  3. Skip forward to Common Flow...

Jose: New to Both Ecosystems

  1. Run curl create.tauri.app | sh that downloads and executes create-tauri-app Rust Engine
  2. Skip forward to Common Flow...

Matéo: Existing Node Project User

  1. npm create tauri-app
    • Runs shell script curl create.tauri.app | sh that downloads and executes create-tauri-app Rust Engine
  2. Skip forward to Common Flow...

Ginevra: Existing Rust Project User

  1. cargo install create-tauri-app
    • Builds create-tauri-app binary
  2. Execute cargo create-tauri-app or create-tauri-app
  3. Skip forward to Common Flow...

Common Flow

  1. ❓ Check if prerequisites are met...
    • Need check with @chippers on what he's building and how it could be integrated
  2. If setup initiated through shell script directly (not via Node)...
    • If a Node project exists...
      • Go to "If setup initiated via Node" step
    • If a cargo project exists...
      • Go to "If setup initiated via cargo..." step
    • Else ask user if they'd like to use Node or cargo
      • Fall through to relevant step based on choice
  3. If setup initiated via Node
    • If there is already a Node project...
      • Add Tauri as dependency
      • Run tauri init prompting for these questions:
        • (Would be good to link to a Getting Started guide that explains each of these commands a bit better before/during being prompted)
        • (Dynamically parse out the project name from package.json)
        1. Before Dev Command
          - ❗️ Would need to be added to tauri init upstream
        2. Dev Path
        3. Before Build Command
          - ❗️ Would need to be added to tauri init upstream
        4. Dist Dir
    • Else set up a new Node project...
      • Ask them which package manager they want to use (yarn, npm, etc.)
      • Ask which frontend template they want to use (vanilla, Svelte, React, etc.)
      • Setup relevant template
  4. If setup initiated via cargo...
    • If there is already a cargo project...
      • Add Tauri to dependencies
      • Ask which frontend template they want to use (vanilla, yew, dominator, etc.)
    • Else setup a new cargo project bootstrapped with the HTML template
  5. Link to the Getting Started Guides

Technical Implementation

Shell Script

Only responsible for downloading and executing the compiled create-tauri-app Rust Engine

Node

Only responsible for downloading and running the shell script (or directly downloading and executing the create-tauri-app Rust Engine)

create-tauri-app Rust Engine

TBD

Templating System

Have some way to have centralised styles and assets to 1) minimise bundle size and 2) centralise styles if we want to update them later.

TBD

Prerequisites Checker

TBD, need to check with @chippers on this and see how we can implement it.

CC @amrbashir @JonasKruckenberg @chippers @FabianLars

Cannot read properties of null (reading 'pickAlgorithm') on install

The problem

I'm trying to get started learning tauri and I'm stuck at the install step. Here's the console output when I run npx create-tauri-app:

npx create-tauri-app
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Need to install the following packages:
  create-tauri-app
Ok to proceed? (y) y
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\brand\AppData\Local\npm-cache\_logs\2022-06-12T06_13_57_600Z-debug-0.log

Relevant version information

Nodejs: 16.15.1
npm: 8.4.1
cargo: 1.53.0
rustc: 1.53.0

Changes for `create-tauri-app@3`

image

  • Remove unpopular templates and keep only 5 Node.js-based templates at a time.
  • Flavor of templates which will be mostly javascript and typescript will be prompted separately after choosing one of the templates
  • Add more Rust-based templates, leptos and dioxus seems like good-candidates, however leptos is not even 0.1 yet and dioxus already offers a desktop framework of their own.
  • --alpha and --mobile options

[bug] yarn start react template

Describe the bug

yarn run v1.22.10
$ cross-env BROWSER=none react-scripts start
/Users/davirain/davirain/hello-world/node_modules/@babel/template/lib/options.js:55
  if (syntacticPlaceholders 
                            

SyntaxError: Unexpected end of input
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1026:15)
    at Module._compile (node:internal/modules/cjs/loader:1061:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/davirain/davirain/hello-world/node_modules/@babel/template/lib/builder.js:8:16)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)

Node.js v17.6.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction

  1. select react template
  2. yarn start

Expected behavior

No response

Platform and versions

Operating System - Mac OS, version 12.0.1 X64

Node.js environment
  Node.js - 17.6.0
  @tauri-apps/cli - 1.0.0-rc.5
  @tauri-apps/api - 1.0.0-rc.1

Global packages
  npm - 8.5.1
  pnpm - Not installed
  yarn - 1.22.10

Rust environment
  rustup - 1.24.3
  rustc - 1.61.0-nightly
  cargo - 1.61.0-nightly
  toolchain - nightly-aarch64-apple-darwin 

App directory structure
/node_modules
/public
/src-tauri
/.git
/src

App
  tauri - 1.0.0-rc.3
  tauri-build - 1.0.0-rc.3
  tao - 0.6.3
  wry - 0.13.3
  build-type - bundle
  CSP - unset
  distDir - ../build
  devPath - http://localhost:3000/
  framework - React

Stack trace

No response

Additional context

No response

[bug] "npm create tauri-app" fails on openSUSE Tumbleweed with "Not a directory" error

Describe the bug

Trying to create a project under openSUSE Tumbleweed with npm create tauri-app, it fails with the following error:

error: Not a directory (os error 20)
npm ERR! code 1
npm ERR! path /tmp
npm ERR! command failed
npm ERR! command sh -c -- create-tauri-app

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/x/.npm/_logs/2022-09-28T16_53_00_647Z-debug-0.log

Same error with any other tool (e.g. yarn).

Reproduction

No response

Expected behavior

No response

Platform and versions

Environment
  › OS: openSUSE 20220926 X64
  › Node.js: 18.9.1
  › npm: 8.19.1
  › pnpm: Not installed!
  › yarn: 1.22.19
  › rustup: 1.25.1
  › rustc: 1.64.0
  › cargo: 1.64.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu 

Stack trace

No response

Additional context

I tried running it with strace utility and the syscall which fails is:

openat(AT_FDCWD, "/usr/bin/node18", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOTDIR (Not a directory)

Node.js installation contains two executables: /usr/bin/node (which seems to be a stub) and /usr/bin/node18 (the real one).
If I rename /usr/bin/node18 to /usr/bin/node then everything works.

This issue is specific to tauri, I tried for example creating other apps like react and it worked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.