tauri-apps / create-tauri-app Goto Github PK
View Code? Open in Web Editor NEWRapidly scaffold out a new tauri app project.
License: Apache License 2.0
Rapidly scaffold out a new tauri app project.
License: Apache License 2.0
Could you please add Qwik to the list of UI templates, many thanks!
The svelte template repo says that the template is archived, and that either the vite-svelte template or svelte kit should be used.
A solution would be to use create-svelte@next package, although svelte-kit is still beta software.
❯ 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)
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate limited. Click on a checkbox below to force their creation now.
tauri
, tauri-build
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@sveltejs/vite-plugin-svelte
, @tauri-apps/api
, @tauri-apps/cli
, @tsconfig/svelte
, @types/react
, @types/react-dom
, @vitejs/plugin-react
, @vitejs/plugin-vue
, react
, react-dom
, solid-js
, svelte
, svelte-check
, svelte-preprocess
, tslib
, typescript
, vite
, vite-plugin-solid
, vue
, vue-tsc
)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/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
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
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.
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.
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>
No response
No response
windows 11
yarn create v1.22.19
[email protected]
No response
No response
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.
rt. Nowadays, create-vue
is more popular when creating vue
project via vite
.
I'm not able to scaffold a Svelte-TS app with vite using the create-tauri cli app
.
Steps to reproduce:
yarn create tauri-app
? 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**
SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.
Software versions:
`success Installed "[email protected]" with binaries:
- create-tauri-app
✔ Choose your package manager · cargo
error: the svelte template is not suppported for the cargo package manager
possible templates for cargo are: [vanilla, yew]
error Command failed.
Exit code: 1
`
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:
icon.icns
file included in tauri (1.17 MB)icon.icns
fileicon.icns
from default src-tauri/tauri.conf.json
.What do you prefer?
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.
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.
Ideally cargo tauri dev
should start the server, so that a separate trunk
command is not needed.
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
No response
No response
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!
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.
yarn create tauri-app
windows10
yarn create tauri-app
windows10
No response
Missing script: "tauri"
No response
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)
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.
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.
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.
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.
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
yarn create tauri-app
Please see the Stack trace section.
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
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)
No response
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
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
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)
https://github.com/tauri-apps/create-tauri-app/search?q=developemnt
I would've created a PR, but I'd prefer not to wrangle GPG to work. Thank you for your time!
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
Application starts both the server and frontend server
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
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.
Thanks for taking a look at this
I've followed Quick Start then saw message
Done, Now run:
cd my-app
cargo tauri dev
but it did not work because tauri-cli
is not installed yet.
An error occurred while creating creating a project.
pnpm create tauri-app
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
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)
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.
error when running tutorial (https://tauri.studio/docs/getting-started/beginning-tutorial)
npx create-tauri-app
# choose vite
# choose vue-ts
No response
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
>> 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_
In the default template for solidjs, App.tsx uses classNames, which although is supported, shows up as an error in vscode when using the default ts language server.
Consider changing these to "class" :)
Cheers ☕️
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
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:
Line 127 in fe5d9ca
When I run under the Windows command line it runs without the error.
Versions:
Git bash: 2.37.1
Node: 16.16.0
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.
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)
It should create package with command:
pnpm create vite tauri-app -- --template vue-ts
insteads of
pnpm create vite tauri-app --template vue-ts
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
No response
No response
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
I don't know if it was by mistake or what happened, but when a project is created, Angular no longer appears to use it as a template, is it possible to return it please?
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:
yarn create tauri-app
it would be nice to know what are 'required' as in, will be prompted if not given as an arg
and what the defaults are if you pass --ci
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?
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
).
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?
Currently, I initialize a new tauri app and then go about installing packages and configs from my custom templates.
No response
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:
In CTA v1, we have a vanilla-ts
option that works by using vite
.
Hope we can have that in CTA v2 also :D
package: create-strapi-app
version: 3.5.4
$ yarn create tauri-app
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.14.0"
Can it support the LTS
version nodejs
?
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
No response
No response
Windows 10
No response
No response
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.
These are the different types of users and the paths they could take when getting started with Tauri.
Benny: New Node Project User
Jannett: New Rust Project User
Jose: New to Both Ecosystems
Matéo: Existing Node Project User
Ginevra: Existing Rust Project User
npm create tauri-app
@tauri-apps/cli
(thanks, Amr!)cargo install create-tauri-app
create-tauri-app
binarycargo create-tauri-app
or create-tauri-app
curl create.tauri.app | sh
that downloads and executes create-tauri-app
Rust Enginenpm create tauri-app
curl create.tauri.app | sh
that downloads and executes create-tauri-app
Rust Enginecargo install create-tauri-app
create-tauri-app
binarycargo create-tauri-app
or create-tauri-app
tauri init
prompting for these questions:
package.json
)tauri init
upstreamtauri init
upstreamOnly responsible for downloading and executing the compiled create-tauri-app
Rust Engine
Only responsible for downloading and running the shell script (or directly downloading and executing the create-tauri-app
Rust Engine)
create-tauri-app
Rust EngineTBD
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
TBD, need to check with @chippers on this and see how we can implement it.
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
Nodejs: 16.15.1
npm: 8.4.1
cargo: 1.53.0
rustc: 1.53.0
javascript
and typescript
will be prompted separately after choosing one of the templatesleptos
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
optionsAdd this browserlist to the fragment templates to match the docs: target: ['es2021', 'chrome97', 'safari13'],
https://tauri.app/v1/guides/getting-started/setup/vite#create-the-frontend
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.
No response
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
No response
No response
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).
No response
No response
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
No response
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.