Comments (9)
can you try this?
npm install github:bmatusiak/gun-rebuild github:bmatusiak/gun-rebuild-sea
import Gun from "gun"
import "gun/sea"
export const db = Gun({ peers: [] })
*dont use axe
. you will run into unexpected issues sometimes
from gun.
Alright, I will give it a try soon
from gun.
Now it is giving the error
Error: Cannot find module './lib/text-encoding'
Require stack:
- [project directory]\.next\server\chunks\[turbopack]_runtime.js
- [project directory]\.next\server\app\page.js
- [project directory]\node_modules\next\dist\server\require.js
- [project directory]\node_modules\next\dist\server\load-components.js
- [project directory]\node_modules\next\dist\build\utils.js
- [project directory]\node_modules\next\dist\server\dev\hot-middleware.js
- [project directory]\node_modules\next\dist\server\dev\hot-reloader-webpack.js
- [project directory]\node_modules\next\dist\server\lib\router-utils\setup-dev-bundler.js
- [project directory]\node_modules\next\dist\server\lib\router-server.js
- [project directory]\node_modules\next\dist\server\lib\start-server.js
from gun.
now add import "gun/lib/mobile"
and do npm install text-encoding buffer
import "gun/lib/mobile"
import Gun from "gun"
import "gun/sea"
export const db = Gun({ peers: [] })
if it goes back to
./node_modules/gun/gun.js:5:16
Module not found
3 | /* UNBUILD */
4 | function USE(arg, req){
> 5 | return req? require(arg) : arg.slice? USE[R(arg)] : function(mod, path){
| ^^^^^^^^^^^^
6 | arg(mod = {exports: {}});
7 | USE[R(path)] = mod.exports;
8 | }
https://nextjs.org/docs/messages/module-not-found
then delete the node_modules
folder in your project and run npm install
in your project , to re-install everything again
from gun.
It is still giving the error Error: Cannot find module './lib/text-encoding'
. I have tried deleting node modules and reinstalling all packages as well.
from gun.
ok so,
i ran npx create-next-app@latest
i did npm install github:amark/gun github:bmatusiak/gun-rebuild github:bmatusiak/gun-rebuild-sea text-encoding buffer
this is my src\pages\index.js
file
// 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
from gun.
when i did import 'gun/lib/mobile';
i got
⨯ .\node_modules\gun\lib\mobile.js:1
import Buffer from "buffer";
^^^^^^
SyntaxError: Cannot use import statement outside a module
it also does not respect the package.json's browser field
from gun.
Related Issues (20)
- [RAD] I'm completely lost... HOT 9
- If you put data in a key with one gun instance, then change that data on another gun instance, the first instance will be unable to read the change HOT 5
- Unable to use Array.push inside once() HOT 1
- Loading sea.js with importScripts fails in worker HOT 6
- [Bug] _ev.off() disables the entire .map() listener, rather than the individual item HOT 1
- Silent Failure on Incorrect Certificate and Delayed put HOT 1
- How to deploy gun server by Docker? HOT 4
- [Question] Netx.js support? HOT 1
- Why is the source code so bad? HOT 2
- Can not access docs HOT 2
- load() issue HOT 2
- Gun integration with express not working HOT 3
- Once dosen't trigger most of the time, when messages are authenticated to an user. HOT 1
- Gun reports all documents always not only changed ones
- Referencing nodes that hold only primitive values HOT 2
- [BUG] Error when importing 'gun/lib/time.js' in nodejs HOT 1
- Use trystero for webrtc (with bittorrent dht signalling) HOT 8
- [BUG] mapping values in gun.user does not work properly HOT 10
- Setup without build tools HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gun.