Open airtonix opened 1 year ago
There's also this from notion settings page:
example stackblitz:
https://stackblitz.com/edit/express-simple-ac4t1u?file=index.js
ehh not sure whats going on but more investigation led me to believe that this project could do with some pretty basic getting started guide that makes no assumptions about knowledge of Notion.
I've never used it before so I just spent the last couple of hours wondering if this repo even works.
After pushing/pressing/sliding/toggling/deleting/creating/screaming at every setting/page/slider/button/toggle/error i could find I eventually discovered that:
> cd Projects
> mkdir notion-test
> git steal git@github.com:NotionX/react-notion-x.git examples/minimal master
💫 stealing git@github.com:NotionX/react-notion-x.git/examples/minimal from master into 💋 /nextjs-notion/
Cloning into '.'...
remote: Enumerating objects: 380, done.
remote: Counting objects: 100% (380/380), done.
remote: Compressing objects: 100% (295/295), done.
remote: Total 380 (delta 84), reused 274 (delta 72), pack-reused 0
Receiving objects: 100% (380/380), 669.34 KiB | 1.54 MiB/s, done.
Resolving deltas: 100% (84/84), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
.
└── examples
└── minimal
├── components
│ └── NotionPage.tsx
├── lib
│ ├── config.ts
│ └── notion.ts
├── next.config.js
├── next-env.d.ts
├── package.json
├── pages
│ ├── _app.tsx
│ ├── _document.tsx
│ ├── index.tsx
│ └── [pageId].tsx
├── public
│ ├── favicon.ico
│ └── robots.txt
├── readme.md
├── styles
│ └── globals.css
├── tsconfig.json
└── yarn.lock
8 directories, 16 files
Done ✅
> cd minimal
✋🏻 🛑 The Minimal Example has Errors
Some errors with the minimal example due to it assuming it runs within the main repo
@next/bundle-analyzer
isn't in thepackage.json
, so delete fromnext.config.js
all references to it.yarn dev
now errors becauseyarn.lock
refers to deps that are only installed in the context of the main repo. I'm only stealing a slice of the main repo.- the yarn.lock is invalid now, so remove it and
yarn
again.yarn dev
works now
> yarn dev
# site works with the example root page: 067dd719a912471ea9a3ac10710e7fdf
switch the root page id to my own.
> yarn dev
yarn run v1.22.19
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled client and server successfully in 256 ms (179 modules)
wait - compiling /_error (client and server)...
event - compiled client and server successfully in 72 ms (180 modules)
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
wait - compiling / (client and server)...
event - compiled client and server successfully in 65 ms (230 modules)
error - Error: Notion page not found "💋"
at E.getPage (file:///home/zenobius/Projects/Mine/Github/nextjs-notion/minimal/node_modules/notion-client/build/index.js:1:641)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getStaticProps (webpack-internal:///./pages/index.tsx:22:23)
at async Object.renderToHTML (/home/zenobius/Projects/Mine/Github/nextjs-notion/minimal/node_modules/next/dist/server/render.js:386:20)
at async doRender (/home/zenobius/Projects/Mine/Github/nextjs-notion/minimal/node_modules/next/dist/server/base-server.js:687:38)
at async cacheEntry.responseCache.get.isManualRevalidate.isManualRevalidate (/home/zenobius/Projects/Mine/Github/nextjs-notion/minimal/node_modules/next/dist/server/base-server.js:796:28)
at async /home/zenobius/Projects/Mine/Github/nextjs-notion/minimal/node_modules/next/dist/server/response-cache/index.js:80:36 {
page: '/'
}
here is where I stumbled upon:
🤔
./toggle
> yarn dev
yarn run v1.22.19
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled client and server successfully in 257 ms (179 modules)
wait - compiling / (client and server)...
event - compiled client and server successfully in 105 ms (229 modules)
Hi there, 💋 {
block: {
'💋-8d0d-5e398197e645': { role: 'reader', value: [Object] },
'💋-bd17-d6334e62a5a9': { role: 'reader', value: [Object] },
'💋-badf-4a95625088fe': { role: 'reader', value: [Object] },
'💋-9d8c-acc40648401e': { role: 'reader', value: [Object] },
'💋-bb01-d647c27d85e8': { role: 'reader', value: [Object] },
'💋-bf3f-fc1b44895b3c': { role: 'reader', value: [Object] },
'💋-a907-bd2c886edef4': { role: 'reader', value: [Object] },
'💋-8e13-e72466ef0c89': { role: 'reader', value: [Object] },
'💋-a634-66976ec7b492': { role: 'reader', value: [Object] },
'💋-bba5-fe4fa96af942': { role: 'reader', value: [Object] },
'💋-866c-9784cf57fc97': { role: 'reader', value: [Object] },
'💋-a226-d938877c54d9': { role: 'reader', value: [Object] },
'💋-991b-02994bc9456a': { role: 'reader', value: [Object] },
'💋-9416-5a064a335a81': { role: 'reader', value: [Object] },
'💋-8742-2fe5a5b3f0c8': { role: 'reader', value: [Object] },
'💋-a599-d006c7d4dde9': { role: 'reader', value: [Object] },
'💋-8fe3-7c049b70b24c': { role: 'reader', value: [Object] },
'💋-9881-074096f47b63': { role: 'reader', value: [Object] },
'💋-9500-ed9573159c5d': { role: 'reader', value: [Object] },
'💋-b9e9-812007b734bb': { role: 'reader', value: [Object] }
},
team: {},
space: {},
collection: {},
collection_view: {},
notion_user: {},
collection_query: {},
signed_urls: {}
}
This is pretty critical information missing from this repo IMO.
btw raised the example errors here #475
Description
print-notion-page.ts
print-notion-page.ts
results in :
Notion Test Page ID
efdb8bdfe54c4f279588f765652c5978