Comments (8)
@atreyasuraj thank you, you should not rename or change anything apart of installing deps. The version zk project
creates currently is different from what it is in that example of specific branch. I'll check it if we missed anything in docs examples.
from docs2.
Hey @atreyasuraj Next.js docs are being updated at the moment.
The complete working example can be found here: https://github.com/o1-labs/docs2/tree/fix/next-project/examples/zkapps/04-zkapp-browser-ui
(don't forget to visit the ./contracts
project and do npm i
+ npm run build
before going back to ./ui
project and start dev server (npm run dev
) or do production builds).
from docs2.
Hi @shimkiv I am still facing the same issues. I followed the same steps as above you mentioned. Below is the error:
> [email protected] dev
> next dev
- ready started server on 0.0.0.0:3000, url: http://localhost:3000
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
- event compiled client and server successfully in 91 ms (18 modules)
- wait compiling...
- event compiled client and server successfully in 75 ms (18 modules)
- wait compiling / (client and server)...
- error ./src/pages/index.page.tsx:1:0
Module not found: Can't resolve 'o1js'
> 1 | import { Field, PublicKey } from 'o1js';
2 | import { useEffect, useState } from 'react';
3 | import GradientBG from '../components/GradientBG.js';
4 | import styles from '../styles/Home.module.css';
https://nextjs.org/docs/messages/module-not-found
- wait compiling /_error (client and server)...
- error ./src/pages/index.page.tsx:1:0
Module not found: Can't resolve 'o1js'
> 1 | import { Field, PublicKey } from 'o1js';
2 | import { useEffect, useState } from 'react';
3 | import GradientBG from '../components/GradientBG.js';
4 | import styles from '../styles/Home.module.css';
https://nextjs.org/docs/messages/module-not-found
from docs2.
@atreyasuraj you probably did but just in case I'll ask it: have you installed (npm i
) the dependencies for the ./ui
project as well?
from docs2.
@atreyasuraj and please make sure you're using same versions as in https://github.com/o1-labs/docs2/blob/fix/next-project/examples/zkapps/04-zkapp-browser-ui/ui/package.json
from docs2.
@shimkiv thanks for the tip! The way I solved it is to create a zk project <project-name>
and copy the ui
directory from the examples
from the https://github.com/o1-labs/docs2/blob/fix/next-project/examples/zkapps/04-zkapp-browser-ui/ui/ into the created project. I think there are a few version mismatch with the ones in the examples
dir compared to what zk project
creates. Another change I had to manually do was to change the index.page.tsx
to index.tsx
Cheers!
from docs2.
So I've checked this projects: https://github.com/o1-labs/docs2/blob/fix/next-project/examples/zkapps/04-zkapp-browser-ui
cd 04-zkapp-browser-ui/contracts
npm i
npm run build
cd ../ui
npm i
npm run dev
- Opened browser and watched how application loaded successfully.
It work fine. @atreyasuraj can you maybe share your project with initial issue you faced while you created this issue?
from docs2.
@shimkiv Yep, exact same steps and I run into the error. I am running this on Mac M1 Pro. Does that matter?
$ ui % npm --version
10.5.0
$ ui % uname -a
Darwin macbook.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
from docs2.
Related Issues (20)
- HF audit: Tutorial 8: Custom tokens HOT 2
- Review: Lightnet docs
- Restructure o1js docs for clearer entry points
- Off-chain Storage MVP docs HOT 1
- Cross contract calls/interoperability/composability in general
- Difference between constants/variables/provable code/JS native code/when to use what
- How to write circuits and how provable code works
- List of common pitfalls for TS devs HOT 1
- How do circuits actually work? Why are some things more efficient than others?
- Add "deploying to mainnet" to how to deploy"
- Update tutorial 4: Build a zkApp UI in the Browser with React
- Review documentation and replace normal text highlighted with code-blocks with something else (bold style).
- Examples of zkApps section is just images
- Disable Examples of zkApps sections
- Add security audit recommendations to intro pages
- Add link to FT Standard docs in Custom Tokens page
- Add reducer limitation warning
- document batch reducer
- document side loading
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 docs2.