项目作者: aaronksaunders

项目描述 :
Sample Application w NextJS & Ionic Framework
高级语言: JavaScript
项目地址: git://github.com/aaronksaunders/ionic-nextjs-1.git
创建时间: 2020-12-23T17:16:23Z
项目社区:https://github.com/aaronksaunders/ionic-nextjs-1

开源协议:

下载


Hello World Example, with Ionic Integrated

Making Ionic Work

I had to include - https://github.com/Yonom/ionic the default ionic did not work, was still throwing errors.

  1. error - ReferenceError: HTMLElement is not defined
  2. at Object.<anonymous> (/Users/aaronksaunders/Downloads/qiqlw/node_modules/@ionic/react/dist/index.js:966:30)
  3. at Module._compile (internal/modules/cjs/loader.js:1151:30)
  4. at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
  5. at Module.load (internal/modules/cjs/loader.js:1000:32)
  6. at Function.Module._load (internal/modules/cjs/loader.js:899:14)
  7. at Module.require (internal/modules/cjs/loader.js:1040:19)
  8. at require (internal/modules/cjs/helpers.js:72:18)
  9. at eval (webpack-internal:///@ionic/react:1:18)
  10. at Object.@ionic/react (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:237:1)
  11. at __webpack_require__ (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:23:31)
  12. at eval (webpack-internal:///./pages/_app.js:4:70)
  13. at Module../pages/_app.js (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:214:1)
  14. at __webpack_require__ (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:23:31)
  15. at Object.0 (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:225:18)
  16. at __webpack_require__ (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:23:31)
  17. at /Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:91:18
  18. (node:96683) UnhandledPromiseRejectionWarning: ReferenceError: HTMLElement is not defined
  19. at Object.<anonymous> (/Users/aaronksaunders/Downloads/qiqlw/node_modules/@ionic/react/dist/index.js:966:30)
  20. at Module._compile (internal/modules/cjs/loader.js:1151:30)
  21. at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
  22. at Module.load (internal/modules/cjs/loader.js:1000:32)
  23. at Function.Module._load (internal/modules/cjs/loader.js:899:14)
  24. at Module.require (internal/modules/cjs/loader.js:1040:19)
  25. at require (internal/modules/cjs/helpers.js:72:18)
  26. at eval (webpack-internal:///@ionic/react:1:18)
  27. at Object.@ionic/react (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:237:1)
  28. at __webpack_require__ (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:23:31)
  29. at eval (webpack-internal:///./pages/_app.js:4:70)
  30. at Module../pages/_app.js (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:214:1)
  31. at __webpack_require__ (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:23:31)
  32. at Object.0 (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:225:18)
  33. at __webpack_require__ (/Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:23:31)
  34. at /Users/aaronksaunders/Downloads/qiqlw/.next/server/pages/_app.js:91:18
  35. (node:96683) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
  36. (node:96683) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

reconfigured my package.json file like so

  1. "@ionic/react": "file:lib/ionic-react-5.4.4.tgz",

This example shows the most basic idea behind Next. We have 2 pages: pages/index.js and pages/about.js. The former responds to / requests and the latter to /about. Using next/link you can add hyperlinks between them with universal routing capabilities. The day directory shows that you can have subdirectories.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Deploy it to the cloud with Vercel (Documentation).