Skip to content

Commit

Permalink
feat(Next.JS): Support server-side Next.JS usage
Browse files Browse the repository at this point in the history
Next.JS disallows relative imports since 12.0.1 (see
https://nextjs.org/docs/messages/middleware-relative-urls for more
information).  So, we need to sniff out if we are in the NEXTJS
environment and if so, use the fallback URL.

This should resolve:
#174

[ Testing: deno task build ]
  • Loading branch information
thaddeusdiamond committed Sep 6, 2023
1 parent 0c8fec0 commit 0a61e5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3811,7 +3811,7 @@ export function isInstantiated() {
*/
async function instantiateModule(opts) {
// Temporary exception for fresh framework
const wasmUrl = import.meta.url.includes("_frsh")
const wasmUrl = (import.meta.url.includes("_frsh") || (globalThis.process?.env?.NEXT_RUNTIME !== undefined))
? opts.url
: new URL("cardano_message_signing_bg.wasm", import.meta.url);
const decompress = opts.decompress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28596,7 +28596,7 @@ export function isInstantiated() {
*/
async function instantiateModule(opts) {
// Temporary exception for fresh framework
const wasmUrl = import.meta.url.includes("_frsh")
const wasmUrl = (import.meta.url.includes("_frsh") || (globalThis.process?.env?.NEXT_RUNTIME !== undefined))
? opts.url
: new URL("cardano_multiplatform_lib_bg.wasm", import.meta.url);
const decompress = opts.decompress;
Expand Down

0 comments on commit 0a61e5b

Please sign in to comment.