Skip to content
Snippets Groups Projects
Verified Commit 3b6b7a0b authored by Mateusz Tyszczak's avatar Mateusz Tyszczak :scroll:
Browse files

Disable Vite SSR due to nuxt-related errors

parent 62466b09
No related branches found
No related tags found
1 merge request!260Typescript & toolset version update
This commit is part of merge request !260. Comments created here will be created in the context of that merge request.
...@@ -8,8 +8,6 @@ Important note!: ...@@ -8,8 +8,6 @@ Important note!:
__**When importing Wax in Vite, remember to import dedicated Vite bundle everywhere in your project: `@hiveio/wax/vite`**__ __**When importing Wax in Vite, remember to import dedicated Vite bundle everywhere in your project: `@hiveio/wax/vite`**__
This should enable partial SSR support along static site generation (based on the `import.meta.env.SSR`)
## WASM-related Vite issues ## WASM-related Vite issues
Internal Note: Internal Note:
......
...@@ -8,8 +8,6 @@ Important note!: ...@@ -8,8 +8,6 @@ Important note!:
__**When importing Wax in Vite, remember to import dedicated Vite bundle everywhere in your project: `@hiveio/wax/vite`**__ __**When importing Wax in Vite, remember to import dedicated Vite bundle everywhere in your project: `@hiveio/wax/vite`**__
This should enable partial SSR support along static site generation (based on the `import.meta.env.SSR`)
## WASM-related Vite issues ## WASM-related Vite issues
Internal Note: Internal Note:
......
...@@ -5,21 +5,10 @@ import { createHiveChain as constructHiveChainWithWasm, createWaxFoundation as c ...@@ -5,21 +5,10 @@ import { createHiveChain as constructHiveChainWithWasm, createWaxFoundation as c
// During bundle - this module will be replaced with the actual wasm module based on your environment // During bundle - this module will be replaced with the actual wasm module based on your environment
import MainModuleFunction from "wasm/lib/wax_module.js"; import MainModuleFunction from "wasm/lib/wax_module.js";
// This will be empty when SSR is disabled (client-side), but enable static import for SSR
import possibleFs from 'node:fs/promises';
const isSSR = typeof (import.meta as any).env === "object" && (import.meta as any).env.SSR;
import resolvedUrl from 'wax.common.wasm?url'; import resolvedUrl from 'wax.common.wasm?url';
const moduleArgs = (async () => { const moduleArgs = (async () => {
let wasmBinary: Buffer | undefined;
if (isSSR)
wasmBinary = await possibleFs.readFile('wax.common.wasm');
return { return {
wasmBinary,
locateFile: (path: string, scriptDirectory: string) => { locateFile: (path: string, scriptDirectory: string) => {
if (path === "wax.common.wasm") if (path === "wax.common.wasm")
return resolvedUrl as unknown as string; return resolvedUrl as unknown as string;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment