From e7dc06ee5e5ce8d7b3645656fede0dfe3770fca0 Mon Sep 17 00:00:00 2001 From: Lulox Date: Tue, 17 Sep 2024 15:57:18 -0300 Subject: [PATCH] Small fix to json viewer --- packages/local_db/firestore-debug.log | 3 ++- packages/local_db/ui-debug.log | 13 +++++++++++-- .../{ => _components}/generateTokenURI.tsx | 0 .../{ => _components}/simpleMintDescription.tsx | 0 packages/nextjs/app/simpleMint/page.tsx | 9 +++++---- 5 files changed, 18 insertions(+), 7 deletions(-) rename packages/nextjs/app/simpleMint/{ => _components}/generateTokenURI.tsx (100%) rename packages/nextjs/app/simpleMint/{ => _components}/simpleMintDescription.tsx (100%) diff --git a/packages/local_db/firestore-debug.log b/packages/local_db/firestore-debug.log index a7020d1..7c63527 100644 --- a/packages/local_db/firestore-debug.log +++ b/packages/local_db/firestore-debug.log @@ -1,4 +1,4 @@ -Sep 17, 2024 12:05:20 AM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start +Sep 17, 2024 3:43:38 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start INFO: Started WebSocket server on ws://127.0.0.1:9150 API endpoint: http://127.0.0.1:8080 If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run: @@ -13,4 +13,5 @@ Note: Support for Datastore Mode is in preview. If you encounter any bugs please Dev App Server is now running. *** shutting down gRPC server since JVM is shutting down +240917 15:43:41.420:I 1 [main] [com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer.stop:80] Stopping WebSocket server... *** server shut down diff --git a/packages/local_db/ui-debug.log b/packages/local_db/ui-debug.log index edaaf3e..3158efa 100644 --- a/packages/local_db/ui-debug.log +++ b/packages/local_db/ui-debug.log @@ -1,2 +1,11 @@ -Web / API server started at 127.0.0.1:4000 -Web / API server started at ::1:4000 +node:internal/modules/cjs/loader:986 + throw new ERR_REQUIRE_ESM(filename, true); + ^ + +Error [ERR_REQUIRE_ESM]: require() of ES Module /home/lulox/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs not supported. +Instead change the require of /home/lulox/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs to a dynamic import() which is available in all CommonJS modules. + at Function.runMain (pkg/prelude/bootstrap.js:1979:12) { + code: 'ERR_REQUIRE_ESM' +} + +Node.js v18.5.0 diff --git a/packages/nextjs/app/simpleMint/generateTokenURI.tsx b/packages/nextjs/app/simpleMint/_components/generateTokenURI.tsx similarity index 100% rename from packages/nextjs/app/simpleMint/generateTokenURI.tsx rename to packages/nextjs/app/simpleMint/_components/generateTokenURI.tsx diff --git a/packages/nextjs/app/simpleMint/simpleMintDescription.tsx b/packages/nextjs/app/simpleMint/_components/simpleMintDescription.tsx similarity index 100% rename from packages/nextjs/app/simpleMint/simpleMintDescription.tsx rename to packages/nextjs/app/simpleMint/_components/simpleMintDescription.tsx diff --git a/packages/nextjs/app/simpleMint/page.tsx b/packages/nextjs/app/simpleMint/page.tsx index 757f2a1..512aa59 100644 --- a/packages/nextjs/app/simpleMint/page.tsx +++ b/packages/nextjs/app/simpleMint/page.tsx @@ -1,9 +1,10 @@ "use client"; -import { lazy, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; +import dynamic from "next/dynamic"; import { TextAreaBase } from "./_components/TextAreaBase"; -import generateTokenURI from "./generateTokenURI"; -import { SimpleMintDescription } from "./simpleMintDescription"; +import generateTokenURI from "./_components/generateTokenURI"; +import { SimpleMintDescription } from "./_components/simpleMintDescription"; import type { NextPage } from "next"; // import useSWRMutation from "swr/mutation"; import { useAccount, useSignTypedData } from "wagmi"; @@ -15,7 +16,7 @@ import { addToIPFS } from "~~/utils/simpleNFT/ipfs-fetch"; // import nftsMetadata from "~~/utils/simpleNFT/nftsMetadata"; // import { postMutationFetcher } from "~~/utils/swr"; -const LazyReactJson = lazy(() => import("react-json-view")); +const LazyReactJson = dynamic(() => import("react-json-view"), { ssr: false }); const SimpleMint: NextPage = () => { const { address: connectedAddress } = useAccount();