Closed MehulKhanna closed 1 year ago
Synth Tutorial: 1 - Install git if you don't have it (most distros have its own version, my case: "sudo pacman -S git")
2 - Follow the instructions at https://rustup.rs/ to install Rust on your machine
3 - Install tauri-cli once the Rust is up and running:
cargo install tauri-cli
4 - Download and install Node into your computer: https://nodejs.org/en/download
5 - Once node is installed run:
npm i --global pnpm
6 - Clone the repository:
git clone https://github.com/StarlaneStudios/Surrealist.git
7 - cd into the repository and run the command:
npm i
8 - Then run:
npm run tauri:build
9 - Depending of your machine the compilation can take some time. So: wait. Check for errors on the terminal.
10 - If no errors came out from the output, check inside repo_location/surrealist/src-tauri/target/release/bundle for the AppImage file.
Build process finished
Starting the client and testing it
11 - Install curl into your system. Donno if you have it.
12 - You will need to install surrealdb most probably, instructions at https://surrealdb.com/install . For linux run the cmd :
curl -sSf https://install.surrealdb.com | sh
13 - Start surreal with the terminal cmd:
surreal start
Keep it alive(the terminal emu. ) 14 - Run the appimage file from repo_location/surrealist/src-tauri/target/release/bundle
npm run tauri:build
Results in:
> tsc && vite build
src/components/ConnectionDetails/index.tsx:7:10 - error TS2305: Module '"~/util/websocket"' has no exported member 'SurrealConnection'.
7 import { SurrealConnection } from "~/util/websocket";
~~~~~~~~~~~~~~~~~
src/components/ConnectionDetails/index.tsx:36:12 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
36 onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:53:33 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
53 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:61:33 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
61 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:69:33 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
69 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:81:37 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
81 onChange={(value) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:91:35 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
91 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:99:35 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
99 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:112:35 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
112 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:147:32 - error TS7006: Parameter 'field' implicitly has an 'any' type.
147 {value.scopeFields?.map((field, i) => (
~~~~~
src/components/ConnectionDetails/index.tsx:147:39 - error TS7006: Parameter 'i' implicitly has an 'any' type.
147 {value.scopeFields?.map((field, i) => (
~
src/components/ConnectionDetails/index.tsx:154:37 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
154 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:162:37 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
162 onChange={(e) => onChange(draft => {
~~~~~
src/components/ConnectionDetails/index.tsx:169:35 - error TS7006: Parameter 'draft' implicitly has an 'any' type.
169 onClick={() => onChange(draft => {
~~~~~
Found 14 errors in the same file, starting at: src/components/ConnectionDetails/index.tsx:7
ELIFECYCLE Command failed with exit code 2.```
Vite build also fails:
❯ pnpm vite build
vite v3.2.5 building for production...
✓ 2013 modules transformed.
rendering chunks (83)...[vite:esbuild-transpile] Transform failed with 2 errors:
assets/index.c6d80a0d.js:226649:15: ERROR: Top-level await is not available in the configured target environment ("safari13" + 2 overrides)
assets/index.c6d80a0d.js:226665:15: ERROR: Top-level await is not available in the configured target environment ("safari13" + 2 overrides)
Top-level await is not available in the configured target environment ("safari13" + 2 overrides)
226647|
226648| dayjs.extend(relativeTime);
226649| const config = await adapter.loadConfig();
| ^
226650| store.dispatch(actions.initialize(config));
226651| const {
Top-level await is not available in the configured target environment ("safari13" + 2 overrides)
226663| children: /* @__PURE__ */ jsx(App, {})
226664| }));
226665| const monaco = await loader.init();
| ^
226666| initializeEditor(monaco);
226667| watchNativeTheme();
error during build:
Error: Transform failed with 2 errors:
assets/index.c6d80a0d.js:226649:15: ERROR: Top-level await is not available in the configured target environment ("safari13" + 2 overrides)
assets/index.c6d80a0d.js:226665:15: ERROR: Top-level await is not available in the configured target environment ("safari13" + 2 overrides)
at failureErrorWithLog (/mnt/dev/thirdparty/Surrealist/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:1575:15)
at /mnt/dev/thirdparty/Surrealist/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:814:29
at responseCallbacks.<computed> (/mnt/dev/thirdparty/Surrealist/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:680:9)
at handleIncomingPacket (/mnt/dev/thirdparty/Surrealist/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:735:9)
at Socket.readFromStdout (/mnt/dev/thirdparty/Surrealist/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:656:7)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)```
Some of these issues are related to ongoing refactoring work in the last few commits, however some appear to be caused by the platform you're compiling it on. I'm mostly working on Surrealist myself and do so using Windows so it's difficult to troubleshoot and fix these issues. I'll see what I can do about it as soon as possible
@Fractal-Tess
While I can't test it myself at the moment, it should be possible to compile from source on linux again
Hi @macjuul
I'm trying to build Surrealist for web on linux, and I'm also running into lots of compile errors calling pnpm embed:build
.
error[E0425]: cannot find function `v128_or` in this scope
--> /home/..../.cargo/registry/src/index.crates.io-6f17d22bba15001f/memchr-2.6.4/src/vector.rs:512:13
|
512 | v128_or(self, vector2)
| ^^^^^^^---------------
| |
| help: try calling `v128_or` as a method: `self.v128_or(vector2)`
error: could not compile `memchr` (lib) due to 550 previous errors
I am using cargo 1.77.1 (e52e36006 2024-03-26)
. Any hunch how I could fix this? Thanks!
Surrealist uses Tauri, so you should be able to build it like any Tauri based application. It should come down to running
pnpm tauri build