Giter Site home page Giter Site logo

transitive-bullshit / nextjs-notion-starter-kit Goto Github PK

View Code? Open in Web Editor NEW
5.8K 5.8K 5.0K 2.74 MB

Deploy your own Notion-powered website in minutes with Next.js and Vercel.

Home Page: https://transitivebullsh.it/nextjs-notion-starter-kit

License: MIT License

TypeScript 82.17% CSS 17.19% JavaScript 0.64%
blog nextjs notion portfolio react react-notion-x

nextjs-notion-starter-kit's Introduction

Example article page

Next.js Notion Starter Kit

The perfect starter kit for building websites with Next.js and Notion.

Build Status Prettier Code Formatting

Intro

This repo is what I use to power my personal blog and portfolio site transitivebullsh.it.

It uses Notion as a CMS, react-notion-x, Next.js, and Vercel.

Features

  • Setup only takes a few minutes (single config file) 💪
  • Robust support for Notion content via react-notion-x
  • Built using Next.js, TS, and React
  • Excellent page speeds
  • Smooth image previews
  • Automatic social images
  • Automatic pretty URLs
  • Automatic table of contents
  • Full support for dark mode
  • Quick search via CMD+K / CMD+P
  • Responsive for different devices
  • Optimized for Next.js and Vercel

Demos

  • Default demo - Deployed from the main branch
  • My site - Deployed from the transitive-bullshit branch

Setup

All config is defined in site.config.ts.

This project requires a recent version of Node.js (we recommend >= 16).

  1. Fork / clone this repo
  2. Change a few values in site.config.ts
  3. npm install
  4. npm run dev to test locally
  5. npm run deploy to deploy to vercel 💪

I tried to make configuration as easy as possible — All you really need to do to get started is edit rootNotionPageId.

We recommend duplicating the default page as a starting point, but you can use any public notion page you want.

Make sure your root Notion page is public and then copy the link to your clipboard. Extract the last part of the URL that looks like 7875426197cf461698809def95960ebf, which is your page's Notion ID.

In order to find your Notion workspace ID (optional), just load any of your site's pages into your browser and open up the developer console. There will be a global variable that you can access called block which is the Notion data for the current page. If you enter block.space_id, it will print out your page's workspace ID.

I recommend setting up a collection on your home page that contains all of your articles / projects / content. There are no structural constraints on your Notion workspace, however, so feel free to add content as you normally would in Notion.

URL Paths

The app defaults to slightly different URL paths in dev vs prod (though pasting any dev pathname into prod will work and vice-versa).

In development, it will use /nextjs-notion-blog-d1b5dcf8b9ff425b8aef5ce6f0730202 which is a slugified version of the page's title suffixed with its Notion ID. I've found that it's really useful to always have the Notion Page ID front and center during local development.

In production, it will use /nextjs-notion-blog which is a bit nicer as it gets rid of the extra ID clutter.

The mapping of Notion ID to slugified page titles is done automatically as part of the build process. Just keep in mind that if you plan on changing page titles over time, you probably want to make sure old links will still work, and we don't currently provide a solution for detecting old links aside from Next.js's built-in support for redirects.

See mapPageUrl and getCanonicalPageId for more details.

You can override the default slug generation on a per-page basis by adding a Slug text property to your database. Any page which has a Slug property will use that as its slug.

NOTE: if you have multiple pages in your workspace with the same slugified name, the app will throw an error letting you know that there are duplicate URL pathnames.

Preview Images

Example preview image

We use next/image to serve images efficiently, with preview images optionally generated via lqip-modern. This gives us extremely optimized image support for sexy smooth images.

Preview images are enabled by default, but they can be slow to generate, so if you want to disable them, set isPreviewImageSupportEnabled to false in site.config.ts.

Redis

If you want to cache generated preview images to speed up subsequent builds, you'll need to first set up an external Redis data store. To enable redis caching, set isRedisEnabled to true in site.config.ts and then set REDIS_HOST and REDIS_PASSWORD environment variables to point to your redis instance.

You can do this locally by adding a .env file:

REDIS_HOST='TODO'
REDIS_PASSWORD='TODO'

If you're not sure which Redis provider to use, we recommend Redis Labs, which provides a free plan.

Note that preview images and redis caching are both optional features. If you’d rather not deal with them, just disable them in your site config.

Styles

All CSS styles that customize Notion content are located in styles/notion.css. They mainly target global CSS classes exported by react-notion-x styles.css.

Every notion block gets its own unique classname, so you can target individual blocks like this:

.notion-block-260baa77f1e1428b97fb14ac99c7c385 {
  display: none;
}

Dark Mode

Light Mode         Dark Mode

Dark mode is fully supported and can be toggled via the sun / moon icon in the footer.

Automatic Social Images

Example social image

All Open Graph and social meta tags are generated from your Notion content, which makes social sharing look professional by default.

Social images are generated automatically using Vercel OG Image Generation. You can tweak the default React template for social images by editing api/social-images.tsx.

You can view an example social image live in production here.

Automatic Table of Contents

Smooth ToC Scrollspy

By default, every article page will have a table of contents displayed as an aside on desktop. It uses scrollspy logic to automatically update the current section as the user scrolls through your document, and makes it really easy to jump between different sections.

If a page has less than minTableOfContentsItems (default 3), the table of contents will be hidden. It is also hidden on the index page and if the browser window is too small.

This table of contents uses the same logic that Notion uses for its built-in Table of Contents block (see getPageTableOfContents for the underlying logic).

Responsive

Mobile article page

All pages are designed to be responsive across common device sizes.

Analytics

Analytics are an optional feature that are easy to enable if you want.

Fathom Analytics

Fathom provides a lightweight alternative to Google Analytics.

To enable, just add a NEXT_PUBLIC_FATHOM_ID environment variable, which will only be used in production.

PostHog Analytics

PostHog provides a lightweight, open source alternative to Google Analytics.

To enable, just add a NEXT_PUBLIC_POSTHOG_ID environment variable, which will only be used in production.

Environment Variables

If you're using Redis, analytics, or any other feature which requires environment variables, then you'll need to add them to your Vercel project.

If you want to test your redis builds with GitHub Actions, then you'll need to edit the default build action to add REDIS_HOST and REDIS_PASSWORD. Here is an example from my personal branch. You'll also need to add these environment variables to your GitHub repo as repository secrets.

Contributing

See the contribution guide and join our amazing list of contributors!

License

MIT © Travis Fischer

Support my open source work by following me on twitter twitter

nextjs-notion-starter-kit's People

Contributors

andrewnt219 avatar bytrangle avatar dizotoff avatar dsarman avatar engageintellect avatar gobyebye avatar gridexx avatar hongzzz avatar jaeseokim avatar jokenpo avatar jonleung avatar jorgeruvalcaba avatar jsonmartin avatar kaichii avatar kimwonj77 avatar ohplz avatar omarcostahamido avatar si1k avatar transitive-bullshit avatar vadorequest avatar voidrender avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nextjs-notion-starter-kit's Issues

Fix mobile style issues

  • header breadcrumbs
  • images stretched instead of fit
  • footer not showing behind safari navbar

Improve blog post header UI

  • the default row / column format for metadata is pretty ugly
    • as a simple fix, maybe hide the title column
  • we don't list the author anywhere

Map URLs with a custom config: is it possible?

Hi, thanks again for the fast fixes, it's really cool 🚀 And I'm very impressed with how fast this whole setup can dump really huge pages.

I have only one last question 😅: is it possible somehow to make custom URLs for multiple slugs?
with some config file with strings like "about": "12jhjkj4234jk;aowoq".
I read the brief documentation, please, point me if I missed something

Build errors

Seems like there are errors with the build commands you mention on the usage section of your README.

Notion link: https://www.notion.so/alejandroakbal/Rule-34-App-6911f3301a2e47268b09d95f3cd4f8ac

Vercel log

09:30:22.668  	Cloning github.com/AlejandroAkbal/docs.r34.app (Branch: main, Commit: 1943a7f)
09:30:23.768  	Cloning completed in 1099ms
09:30:23.771  	Analyzing source code...
09:30:24.193  	Installing build runtime...
09:30:24.715  	Build runtime installed: 521.766ms
09:30:25.323  	Installing build runtime...
09:30:25.816  	Build runtime installed: 492.375ms
09:30:26.425  	Installing build runtime...
09:30:26.915  	Build runtime installed: 490.056ms
09:30:27.522  	Installing build runtime...
09:30:28.017  	Build runtime installed: 495.611ms
09:30:28.620  	Installing build runtime...
09:30:29.111  	Build runtime installed: 490.188ms
09:30:29.713  	Installing build runtime...
09:30:31.776  	Build runtime installed: 2062.269ms
09:30:34.093  	Looking up build cache...
09:30:34.164  	Build cache not found
09:30:34.301  	Looking up build cache...
09:30:34.408  	Build cache not found
09:30:34.667  	Looking up build cache...
09:30:34.720  	Build cache not found
09:30:34.805  	Looking up build cache...
09:30:34.850  	Looking up build cache...
09:30:34.854  	Build cache not found
09:30:34.888  	Build cache not found
09:30:35.312  	Warning: Due to `engines` existing in your `package.json` file, the Node.js Version defined in your Project Settings will not apply. Learn More: http://vercel.link/node-version
09:30:35.323  	Installing dependencies...
09:30:35.542  	Warning: Due to `engines` existing in your `package.json` file, the Node.js Version defined in your Project Settings will not apply. Learn More: http://vercel.link/node-version
09:30:35.545  	Installing dependencies...
09:30:35.863  	Warning: Due to `engines` existing in your `package.json` file, the Node.js Version defined in your Project Settings will not apply. Learn More: http://vercel.link/node-version
09:30:35.866  	Installing dependencies...
09:30:36.008  	yarn install v1.22.10
09:30:36.078  	Warning: Due to `engines` existing in your `package.json` file, the Node.js Version defined in your Project Settings will not apply. Learn More: http://vercel.link/node-version
09:30:36.082  	Installing dependencies...
09:30:36.119  	[1/5] Validating package.json...
09:30:36.123  	[2/5] Resolving packages...
09:30:36.135  	Warning: Due to `engines` existing in your `package.json` file, the Node.js Version defined in your Project Settings will not apply. Learn More: http://vercel.link/node-version
09:30:36.137  	Installing dependencies...
09:30:36.422  	[3/5] Fetching packages...
09:30:50.905  	info [email protected]: The platform "linux" is incompatible with this module.
09:30:50.905  	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
09:30:50.913  	[4/5] Linking dependencies...
09:30:50.914  	warning " > [email protected]" has unmet peer dependency "prop-types@^15.5.4".
09:30:50.915  	warning " > [email protected]" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
09:30:50.915  	warning " > [email protected]" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
09:30:50.916  	warning " > [email protected]" has incorrect peer dependency "puppeteer@^2".
09:30:50.917  	warning "react-notion-x > [email protected]" has unmet peer dependency "@babel/runtime@>=7".
09:30:50.917  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^15 || ^16".
09:30:50.917  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^15 || ^16".
09:30:50.919  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^16.3.0".
09:30:50.919  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^16.3.0".
09:30:50.920  	warning "react-notion-x > react-pdf > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:30:50.920  	warning "react-notion-x > react-pdf > pdfjs-dist > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:30:50.920  	warning " > [email protected]" has incorrect peer dependency "react@^16.8.0".
09:30:50.920  	warning "use-dark-mode > @use-it/[email protected]" has incorrect peer dependency "react@^16.8.0".
09:31:01.239  	[5/5] Building fresh packages...
09:31:06.999  	Done in 31.00s.
09:31:07.207  	yarn install v1.22.10
09:31:07.261  	Using TypeScript 4.1.3 (local user-provided)
09:31:07.316  	[1/5] Validating package.json...
09:31:07.319  	[2/5] Resolving packages...
09:31:07.719  	[3/5] Fetching packages...
09:31:08.261  	info [email protected]: The platform "linux" is incompatible with this module.
09:31:08.262  	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
09:31:08.273  	[4/5] Linking dependencies...
09:31:08.275  	warning " > [email protected]" has unmet peer dependency "prop-types@^15.5.4".
09:31:08.275  	warning " > [email protected]" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
09:31:08.275  	warning " > [email protected]" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
09:31:08.276  	warning " > [email protected]" has incorrect peer dependency "puppeteer@^2".
09:31:08.277  	warning "react-notion-x > [email protected]" has unmet peer dependency "@babel/runtime@>=7".
09:31:08.277  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^15 || ^16".
09:31:08.277  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^15 || ^16".
09:31:08.278  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^16.3.0".
09:31:08.278  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^16.3.0".
09:31:08.279  	warning "react-notion-x > react-pdf > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:31:08.279  	warning "react-notion-x > react-pdf > pdfjs-dist > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:31:08.280  	warning " > [email protected]" has incorrect peer dependency "react@^16.8.0".
09:31:08.280  	warning "use-dark-mode > @use-it/[email protected]" has incorrect peer dependency "react@^16.8.0".
09:31:17.781  	Uploading build outputs...
09:31:22.345  	Looking up build cache...
09:31:22.390  	Build cache not found
09:31:23.179  	Warning: Due to `engines` existing in your `package.json` file, the Node.js Version defined in your Project Settings will not apply. Learn More: http://vercel.link/node-version
09:31:23.189  	Running "install" command: `npm install`...
09:31:23.264  	[5/5] Building fresh packages...
09:31:29.023  	Done in 21.82s.
09:31:29.211  	yarn install v1.22.10
09:31:29.239  	Using TypeScript 4.1.3 (local user-provided)
09:31:29.310  	[1/5] Validating package.json...
09:31:29.314  	[2/5] Resolving packages...
09:31:29.669  	[3/5] Fetching packages...
09:31:30.202  	info [email protected]: The platform "linux" is incompatible with this module.
09:31:30.202  	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
09:31:30.216  	[4/5] Linking dependencies...
09:31:30.218  	warning " > [email protected]" has unmet peer dependency "prop-types@^15.5.4".
09:31:30.219  	warning " > [email protected]" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
09:31:30.219  	warning " > [email protected]" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
09:31:30.221  	warning " > [email protected]" has incorrect peer dependency "puppeteer@^2".
09:31:30.222  	warning "react-notion-x > [email protected]" has unmet peer dependency "@babel/runtime@>=7".
09:31:30.222  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^15 || ^16".
09:31:30.222  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^15 || ^16".
09:31:30.223  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^16.3.0".
09:31:30.223  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^16.3.0".
09:31:30.224  	warning "react-notion-x > react-pdf > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:31:30.224  	warning "react-notion-x > react-pdf > pdfjs-dist > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:31:30.225  	warning " > [email protected]" has incorrect peer dependency "react@^16.8.0".
09:31:30.225  	warning "use-dark-mode > @use-it/[email protected]" has incorrect peer dependency "react@^16.8.0".
09:31:41.662  	[5/5] Building fresh packages...
09:31:41.729  	Uploading build outputs...
09:31:47.264  	Done with "api/render-social-image/[pageId].ts"
09:31:48.550  	Done in 19.34s.
09:31:48.732  	yarn install v1.22.10
09:31:48.767  	Using TypeScript 4.1.3 (local user-provided)
09:31:48.832  	[1/5] Validating package.json...
09:31:48.834  	[2/5] Resolving packages...
09:31:49.224  	[3/5] Fetching packages...
09:31:49.704  	info [email protected]: The platform "linux" is incompatible with this module.
09:31:49.704  	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
09:31:49.743  	[4/5] Linking dependencies...
09:31:49.743  	warning " > [email protected]" has unmet peer dependency "prop-types@^15.5.4".
09:31:49.743  	warning " > [email protected]" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
09:31:49.743  	warning " > [email protected]" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
09:31:49.743  	warning " > [email protected]" has incorrect peer dependency "puppeteer@^2".
09:31:49.743  	warning "react-notion-x > [email protected]" has unmet peer dependency "@babel/runtime@>=7".
09:31:49.743  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^15 || ^16".
09:31:49.743  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^15 || ^16".
09:31:49.744  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^16.3.0".
09:31:49.744  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^16.3.0".
09:31:49.744  	warning "react-notion-x > react-pdf > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:31:49.744  	warning "react-notion-x > react-pdf > pdfjs-dist > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:31:49.744  	warning " > [email protected]" has incorrect peer dependency "react@^16.8.0".
09:31:49.744  	warning "use-dark-mode > @use-it/[email protected]" has incorrect peer dependency "react@^16.8.0".
09:31:56.909  	Uploading build outputs...
09:31:59.022  	Done with "api/search-notion.ts"
09:32:01.228  	[5/5] Building fresh packages...
09:32:06.850  	Done in 18.12s.
09:32:07.067  	Using TypeScript 4.1.3 (local user-provided)
09:32:10.943  	Uploading build outputs...
09:32:12.624  	Done with "api/robots.txt.ts"
09:32:21.181  	npm WARN deprecated @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
09:32:21.300  	npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
09:32:24.249  	npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
09:32:35.300  	npm WARN rm not removing /vercel/workpath0/node_modules/.bin/semver as it wasn't installed by /vercel/workpath0/node_modules/semver
09:32:39.778  	> [email protected] install /vercel/workpath0/node_modules/next/node_modules/sharp
09:32:39.778  	> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
09:32:39.991  	info sharp Using cached /vercel/.npm/_libvips/libvips-8.10.0-linux-x64.tar.br
09:32:40.923  	> [email protected] install /vercel/workpath0/node_modules/sharp
09:32:40.924  	> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
09:32:41.128  	info sharp Using cached /vercel/.npm/_libvips/libvips-8.9.1-linux-x64.tar.gz
09:32:41.744  	> [email protected] install /vercel/workpath0/node_modules/puppeteer
09:32:41.744  	> node install.js
09:32:46.927  	Chromium (818858) downloaded to /vercel/workpath0/node_modules/puppeteer/.local-chromium/linux-818858
09:32:46.979  	> [email protected] postinstall /vercel/workpath0/node_modules/core-js
09:32:46.979  	> node -e "try{require('./postinstall')}catch(e){}"
09:32:47.089  	> [email protected] postinstall /vercel/workpath0/node_modules/protobufjs
09:32:47.089  	> node scripts/postinstall
09:32:47.209  	> @ampproject/[email protected] postinstall /vercel/workpath0/node_modules/@ampproject/toolbox-optimizer
09:32:47.209  	> node lib/warmup.js
09:32:47.540  	Browserslist: caniuse-lite is outdated. Please run:
09:32:47.540  	npx browserslist@latest --update-db
09:32:47.733  	�[7mAMP OPTIMIZER�[0m Downloaded latest AMP runtime data.
09:32:48.029  	npm notice created a lockfile as package-lock.json. You should commit this file.
09:32:48.034  	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents):
09:32:48.034  	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
09:32:48.040  	npm WARN [email protected] requires a peer of react@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
09:32:48.047  	npm WARN [email protected] requires a peer of react-dom@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
09:32:48.051  	npm WARN [email protected] requires a peer of puppeteer@^2 but none is installed. You must install peer dependencies yourself.
09:32:48.057  	npm WARN [email protected] requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
09:32:48.062  	npm WARN [email protected] requires a peer of react@^16.3.0 but none is installed. You must install peer dependencies yourself.
09:32:48.069  	npm WARN [email protected] requires a peer of react-dom@^16.3.0 but none is installed. You must install peer dependencies yourself.
09:32:48.074  	npm WARN [email protected] requires a peer of react@^15 || ^16 but none is installed. You must install peer dependencies yourself.
09:32:48.081  	npm WARN [email protected] requires a peer of react-dom@^15 || ^16 but none is installed. You must install peer dependencies yourself.
09:32:48.087  	npm WARN [email protected] requires a peer of webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
09:32:48.093  	npm WARN [email protected] requires a peer of webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
09:32:48.098  	npm WARN @use-it/[email protected] requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
09:32:48.100  	added 38 packages from 82 contributors, removed 45 packages, updated 732 packages and audited 794 packages in 40.816s
09:32:48.295  	93 packages are looking for funding
09:32:48.295  	  run `npm fund` for details
09:32:48.296  	found 0 vulnerabilities
09:32:48.534  	yarn install v1.22.10
09:32:48.561  	Running "npm run deploy"
09:32:48.644  	[1/5] Validating package.json...
09:32:48.647  	[2/5] Resolving packages...
09:32:48.807  	> [email protected] deploy /vercel/workpath0
09:32:48.807  	> vercel --prod
09:32:48.812  	sh: vercel: command not found
09:32:48.815  	npm ERR! code ELIFECYCLE
09:32:48.815  	npm ERR! syscall spawn
09:32:48.815  	npm ERR! file sh
09:32:48.815  	npm ERR! errno ENOENT
09:32:48.817  	npm ERR! [email protected] deploy: `vercel --prod`
09:32:48.817  	npm ERR! spawn ENOENT
09:32:48.817  	npm ERR! 
09:32:48.818  	npm ERR! Failed at the [email protected] deploy script.
09:32:48.818  	npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
09:32:48.823  	npm ERR! A complete log of this run can be found in:
09:32:48.823  	npm ERR!     /vercel/.npm/_logs/2021-02-08T09_32_48_818Z-debug.log
09:32:48.830  	Error: Command "npm run deploy" exited with 1
09:32:48.922  	[3/5] Fetching packages...
09:32:49.272  	info [email protected]: The platform "linux" is incompatible with this module.
09:32:49.272  	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
09:32:49.280  	[4/5] Linking dependencies...
09:32:49.282  	warning " > [email protected]" has unmet peer dependency "prop-types@^15.5.4".
09:32:49.282  	warning " > [email protected]" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
09:32:49.282  	warning " > [email protected]" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
09:32:49.283  	warning " > [email protected]" has incorrect peer dependency "puppeteer@^2".
09:32:49.284  	warning "react-notion-x > [email protected]" has unmet peer dependency "@babel/runtime@>=7".
09:32:49.284  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^15 || ^16".
09:32:49.284  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^15 || ^16".
09:32:49.285  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react@^16.3.0".
09:32:49.285  	warning "react-notion-x > [email protected]" has incorrect peer dependency "react-dom@^16.3.0".
09:32:49.288  	warning "react-notion-x > react-pdf > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:32:49.288  	warning "react-notion-x > react-pdf > pdfjs-dist > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0".
09:32:49.288  	warning " > [email protected]" has incorrect peer dependency "react@^16.8.0".
09:32:49.288  	warning "use-dark-mode > @use-it/[email protected]" has incorrect peer dependency "react@^16.8.0".
09:32:59.948  	[5/5] Building fresh packages...
09:33:05.591  	Done in 17.06s.
09:33:05.805  	Using TypeScript 4.1.3 (local user-provided)

PDF only shows the first page

I wanted to enable PDF by adding import { NotionRenderer, Equation, Pdf, Code, Collection, CollectionRow } from 'react-notion-x' and pdf: Pdf,. It seems that it works. But it only shows the first page while the PDF has 31 pages! What's wrong with it?

Add support for pages without header

Hello, great repo, thank you for the work 🙏

Are you planning to add support for pages that do not include a header?
As you can see on the screenshot there is an empty space and the part of the title is hidden by the avatar:
image

TypeError: contentBlockIds.flatMap is not a function

So I cloned this repo and did the usual npm install and npm run dev (thus the page would be directed to your default public page)

But as soon as it compiled and I tried loading localhost:3000 this error propped (see image below)

notion_error

Any kind of help would be appreciated!

My stack is
Windows 10 and npm version of 6.9.0

HTTPError: Response code 418 (I'm a Teapot)

I want to enable preview image support, so I set up my firebase.
But when I was deploying, Vercel told me


page load error {
--
11:18:07.713 | pageId: '123b34e0-320e-42a8-b02e-3af7553a2bbc',
11:18:07.713 | spaceId: 'f225ce83-48e1-4217-8126-c47ff80789dc'
11:18:07.713 | } HTTPError: Response code 418 (I'm a Teapot)
11:18:07.713 | at Request.<anonymous> (/vercel/workpath3/node_modules/got/dist/source/as-promise/index.js:117:42)
11:18:07.713 | at processTicksAndRejections (internal/process/task_queues.js:97:5) {
11:18:07.713 | code: undefined,
11:18:07.713 | timings: {
11:18:07.713 | start: 1612408687533,
11:18:07.713 | socket: 1612408687534,
11:18:07.713 | lookup: 1612408687558,
11:18:07.713 | connect: 1612408687569,
11:18:07.713 | secureConnect: 1612408687595,
11:18:07.713 | upload: 1612408687595,
11:18:07.713 | response: 1612408687710,
11:18:07.713 | end: 1612408687710,
11:18:07.713 | error: undefined,
11:18:07.713 | abort: undefined,
11:18:07.713 | phases: {
11:18:07.713 | wait: 1,
11:18:07.713 | dns: 24,
11:18:07.713 | tcp: 11,
11:18:07.713 | tls: 26,
11:18:07.713 | request: 0,
11:18:07.713 | firstByte: 115,
11:18:07.713 | download: 0,
11:18:07.714 | total: 177
11:18:07.714 | }
11:18:07.714 | }
11:18:07.714 | }

When I disabled the preview image support, it went back to normal.

This is the content in vercel.json
imag1.png

Here is the information from firestore
imag2.png

This is the firestore rule:
imag3.png

The full Vercel output

Do you know what is wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.