Commit graph

14 commits

Author SHA1 Message Date
laiso
2c9c07f96d
Update Electron, Typescript example (#15524)
It seems like the error occurs with `next export` when building the current example.

```
$ cd examples/with-electron-typescript
$ yarn && yarn build

Error occurred prerendering page "/detail". Read more: https://err.sh/next.js/prerender-error
Error: Error for page /detail: pages with `getServerSideProps` can not be exported. See more info here: https://err.sh/next.js/gssp-export
Error: Export encountered errors on following paths:
        /detail
    at exportApp (/Users/kstg/src/github.com/zeit/next.js/examples/with-electron-typescript/node_modules/next/dist/export/index.js:22:1166)
error Command failed with exit code 1.   
```

I changed routes to statically resolve pages generating from `pages/detail.tsx` and added `getStaticPaths` and `getStaticProps`. so then it will export as follows

```
yarn run v1.22.4
$ next build renderer && next export renderer
Creating an optimized production build...

Compiled successfully.

Automatically optimizing pages...

Page                            Size     First Load JS
┌ ○ /                           336 B          62.6 kB
├ ○ /404                        2.54 kB        61.6 kB
├ ○ /about                      338 B          62.6 kB
├ ● /detail/[id]                440 B          62.7 kB
├   ├ /detail/101
├   ├ /detail/102
├   ├ /detail/103
├   └ /detail/104
└ ● /initial-props              530 B          62.8 kB
+ First Load JS shared by all   59.1 kB
  ├ static/pages/_app.js        983 B
  ├ chunks/commons.9facbe.js    10.9 kB
  ├ chunks/framework.b76773.js  40.3 kB
  ├ runtime/main.800476.js      6.22 kB
  └ runtime/webpack.c21266.js   746 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)

> using build directory: /Users/kstg/src/github.com/zeit/next.js/examples/with-electron-typescript/renderer/.next
  copying "static build" directory
> No "exportPathMap" found in "next.config.js". Generating map from "./pages"
  launching 7 workers
Exporting (0/4)
Exporting (1/4)
Exporting (2/4)
Exporting (3/4)
Exporting (4/4)

Export successful
Done in 11.47s.
```
2020-07-28 23:00:56 +00:00
Tanmay Laud
f00ad581a1
Added .gitignore to examples that are deployed to vercel (#15127)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-16 10:52:23 -04:00
Todor Totev
097287489f
[Examples] Refactor with-electron-typescript (#13802)
Related to [11014](https://github.com/vercel/next.js/issues/11014).

Removed getInitialProps in favor of getStaticProps and getServerSideProps. Refactored one of the components from class to functional. Removed redundant imports. Removed React.FC/FunctionComponent. Added two build files to gitignore.

Let me know if you want something to be changed.
2020-06-05 16:00:10 +00:00
Joe Haddad
7d038dfef1
Suggest npx over npm init (#13637)
This updates old examples to the more universal `npx` command.

Fixes https://github.com/vercel/next.js/discussions/12103
2020-06-01 17:36:57 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
JJ Kasper
1f6ce106ae
Update codeload and deploy links for org rename (#13141)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:11:39 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Minh Nguyen
ec76d9265c
Rename functional component -> function component (#11850)
See the following for context:

- https://reactjs.org/docs/components-and-props.html#function-and-class-components
- https://overreacted.io/how-are-function-components-different-from-classes/
- https://twitter.com/dan_abramov/status/1057625147216220162
- https://twitter.com/kentcdodds/status/1136274289965928448
2020-04-13 11:33:06 +02:00
Shu Uesugi
6804039e94 Make example READMEs more consistent (#10124)
* npx create → npm init

* Fix inconsistent instructions

* Update amp-first

* Update with-graphql-react

* with-firebase-cloud-messaging

* Update with-higher-order-component

* change create-next-app url

* Update create-next-app instruction

* Update instructions to use npm instead of npx

* Move "the idea behind the example" to top

* Rename

* Rename

* Update contributing.md with a README template
2020-01-16 23:23:56 +01:00
Jeremy Asuncion
1f9a40b644 Fix source in electron build (#9802)
* copy only compiled files into electron build for with-electron-typescript

* updated npm deps for with-electron-typescript

* copy only compiled files into electron build for with-electron

* updated npm deps for with-electron

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2019-12-21 13:25:27 -06:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Luis Alvarez D
f10f3304fe Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
Lukáš Huvar
7863b60ef6 Prettier fix (#8754) 2019-09-16 15:24:42 +02:00
Jakub Karabuła-Stysiak
5496e0f8b3 Add electron typescript example (#8682)
* Add initial Electron-Typescript-Next example

* Move and add types

* Update readme

* Update renderer

* remove config
2019-09-10 14:22:00 -05:00