-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gun not working with next.js 14.0.4 #1352
Comments
can you try this?
*dont use |
Alright, I will give it a try soon |
Now it is giving the error
|
now add
if it goes back to
then delete the |
It is still giving the error |
ok so, i ran i did this is my // import Image from 'next/image'
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
import Buffer from "buffer";
import { TextEncoder, TextDecoder } from "text-encoding";
global.Buffer = global.Buffer || Buffer.Buffer;
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
import Gun from "gun/gun"
import "gun/sea"
export const db = Gun({ peers: [] })
export default function Home() {
return (
<main
className={`flex min-h-screen flex-col items-center justify-between p-24 ${inter.className}`}
>
Hello World
</main>
)
} this works for me |
when i did i got
it also does not respect the package.json's browser field |
Same problem here, im using sveltekit and im getting the same error:
Im using vercel to host the app... Also made a post about this on stackoverflow: Actually got it working posted the answer on the stackoverflow link above. |
@smasgl @bmatusiak gaaah, thank you for looking at this. I have very difficult time understanding how to get these types of issues fixed in a way that works uniformly across all environments. Especially because GUN is already-built, it doesn't need build. Do you have any new ideas @bmatusiak ? |
This doesn;t work for me |
@mbj36 i can confirm that it does work.. npx create-next-app@latest
√ What is your project named? ... my-app
√ Would you like to use TypeScript? ... No / Yes <-- No
√ Would you like to use ESLint? ... No / Yes <-- Yes
√ Would you like to use Tailwind CSS? ... No / Yes <-- Yes
√ Would you like to use `src/` directory? ... No / Yes <-- Yes
√ Would you like to use App Router? (recommended) ... No / Yes <-- No
√ Would you like to customize the default import alias (@/*)? ... No / Yes <-- No npx create-next-app@latest
npm install github:amark/gun github:bmatusiak/gun-rebuild github:bmatusiak/gun-rebuild-sea text-encoding buffer
import Image from "next/image";
import { Inter } from "next/font/google";
const inter = Inter({ subsets: ["latin"] });
import Buffer from "buffer";
import { TextEncoder, TextDecoder } from "text-encoding";
global.Buffer = global.Buffer || Buffer.Buffer;
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
import Gun from "gun/gun"
import "gun/sea"
export const db = Gun({ peers: [] })
export default function Home() {
return (
<main
className={`flex min-h-screen flex-col items-center justify-between p-24 ${inter.className}`}
>
Hello World
</main>
)
}
|
@bmatusiak It doesn't work for me! here is the log
|
@mbj36 can you provide your commands and logs to install gun? |
@bmatusiak Here is my package json, i am using updated version of next
|
just a thought.. can you play around with turning it seems that the
if not it tried to load it up in sea
and when i run with your package,json, it works for me,. |
I am currently trying out Gun with next.js and I came across a problem. Next.js is throwing an error which states
My gun version is 0.2020.1239
Here is my code for context.
I am importing the
db
variable to multiple componentsThe text was updated successfully, but these errors were encountered: