AbdelilahOu / Mahalli-tauri

Local First Inventory & invoicing management app built using tauri, vue-3, sqlite, sea-orm/sea-query, shadcn-vue
Other
25 stars 4 forks source link

Failed to build #18

Closed karesztrk closed 2 months ago

karesztrk commented 2 months ago

System: OS: Linux 6.10 Garuda Linux CPU: (12) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz Memory: 15.14 GB / 30.96 GB Shell: 3.7.1 - /bin/fish Binaries: Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm pnpm: 9.5.0 - ~/.local/share/pnpm/pnpm Managers: Cargo: 1.81.0 - /usr/bin/cargo Languages: Rust: 1.81.0 - /usr/bin/rustc Databases: SQLite: 3.46.1 - /usr/bin/sqlite3

pnpm tauri build

> mahalli@1.4.6 tauri /home/ktorok/Projects/Mahalli-tauri
> tauri "build"

     Running beforeBuildCommand `npm run build`

> mahalli@1.4.6 build
> run-p type-check build-only

> mahalli@1.4.6 type-check
> vue-tsc --build --force

> mahalli@1.4.6 build-only
> vite build

vite v5.4.6 building for production...
src/pages/index/clients/[id].vue:12:9 - error TS2339: Property 'id' does not exist on type 'Record<never, never> | { id: string; } | { id: string; } | { id: string; } | { id: string; } | { id: string; }'.

12 const { id } = useRoute().params;
           ~~

src/pages/index/invoices/[id].vue:22:30 - error TS2339: Property 'id' does not exist on type 'Record<never, never> | { id: string; } | { id: string; } | { id: string; } | { id: string; } | { id: string; }'.
  Property 'id' does not exist on type 'Record<never, never>'.

22 const id = useRoute().params.id;
                                ~~

src/pages/index/orders/[id].vue:22:30 - error TS2339: Property 'id' does not exist on type 'Record<never, never> | { id: string; } | { id: string; } | { id: string; } | { id: string; } | { id: string; }'.
  Property 'id' does not exist on type 'Record<never, never>'.

22 const id = useRoute().params.id;
                                ~~

src/pages/index/quotes/[id].vue:22:30 - error TS2339: Property 'id' does not exist on type 'Record<never, never> | { id: string; } | { id: string; } | { id: string; } | { id: string; } | { id: string; }'.
  Property 'id' does not exist on type 'Record<never, never>'.

22 const id = useRoute().params.id;
                                ~~

src/pages/index/suppliers/[id].vue:12:9 - error TS2339: Property 'id' does not exist on type 'Record<never, never> | { id: string; } | { id: string; } | { id: string; } | { id: string; } | { id: string; }'.

12 const { id } = useRoute().params;
           ~~

Found 5 errors.

ERROR: "type-check" exited with 2.
       Error beforeBuildCommand `npm run build` failed with exit code 1
 ELIFECYCLE  Command failed with exit code 1.

dev` fails with something else

error: invalid character `{` in package name: `tauri-plugin-{{name}}`, characters must be Unicode XID characters
 (numbers, `-`, `_`, or most letters)
 --> ../../../.cargo/git/checkouts/plugins-workspace-fd0259fcb18f51ad/ed682dd/shared/template/Cargo.toml:2:8
  |
2 | name = "tauri-plugin-{{name}}"
  |        ^^^^^^^^^^^^^^^^^^^^^^^
  |
   Compiling system-deps v6.1.1
   Compiling glib-macros v0.15.13
   Compiling time v0.3.22
   Compiling soup2-sys v0.2.0
   Compiling serde_json v1.0.100
   Compiling sqlformat v0.2.3
   Compiling native-tls v0.2.11
   Compiling html5ever v0.26.0
   Compiling paste v1.0.14
   Compiling memoffset v0.9.0
   Compiling hashlink v0.8.4
   Compiling indexmap v2.0.0
   Compiling fdeflate v0.3.0
   Compiling selectors v0.22.0
   Compiling async-channel v1.9.0
   Compiling rustls-pemfile v1.0.4
   Compiling javascriptcore-rs-sys v0.4.0
   Compiling sha2 v0.10.7
   Compiling ordered-float v3.9.2
error[E0282]: type annotations needed for `Box<_>`
  --> /home/ktorok/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.22/src/format_description/parse
/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to v
ersion `>=0.3.35` by calling `cargo update`

   Compiling atoi v2.0.0
AbdelilahOu commented 2 months ago

To fix the build error, coused by compiling time crate, all you need to do is navigate to the src-tauri folder and run cargo update

karesztrk commented 2 months ago

To fix the build error, coused by compiling time crate, all you need to do is navigate to the src-tauri folder and run cargo update

The tauri dev has been fixed indeed. But tauri build is still failing with the same Typescript error. So I removed the type check from the package.json. The prod build worked. Great :+1:

Is there a way to clear the seeded database? where is it stored? Thanks

AbdelilahOu commented 2 months ago

That's great. If you wanna remove seed migrations, check this issue

AbdelilahOu commented 2 months ago

In case you wanna access db directly or wanna remove it : Dev: the db file inside the src-tauri/mahalli.db Prod: the db is inside the dataDir (check tauri path api) .mahalli/data

karesztrk commented 2 months ago

In case you wanna access db directly or wanna remove it : Dev: the db file inside the src-tauri/mahalli.db Prod: the db is inside the dataDir (check tauri path api) .mahalli/data

Thanks