Home > Net >  Issue deploying Nuxt static site to Netlify using Github
Issue deploying Nuxt static site to Netlify using Github

Time:12-16

I'm having issues deploying my Nuxt static site (build with Bootstrap Vue and using Wordpress Rest API) to Netlify using Github. When I deploy it manually it works just as expected. But when I use Github it gives me the "Page Not Found-message" for most of the pages and for those pages that don't get that error it doesn't provide all the page content.

I have followed the Nuxt configure for a statically generated site: [https://nuxtjs.org/deployments/netlify/#for-a-statically-generated-site][1]. I have also tried to change the NODE_VERSION environment variable but without success. Does anyone have a suggestion for a solution to this problem?

This is the deploy log from Netlify

11:26:18 AM: build-image version: a6bb34428a07e7de82f4df5dfe1843fbde91f670 (focal)
11:26:18 AM: build-image tag: v4.5.1
11:26:18 AM: buildbot version: 5284b4d1b8b4cf691b29019968d8e4eb3089acdd
11:26:18 AM: Fetching cached dependencies
11:26:18 AM: Failed to fetch cache, continuing with build
11:26:18 AM: Starting to prepare the repo for build
11:26:19 AM: No cached dependencies found. Cloning fresh repo
11:26:19 AM: git clone https://github.com/DianaNilsson/devmore-headless-wp
11:26:19 AM: Preparing Git Reference refs/heads/master
11:26:20 AM: Parsing package.json dependencies
11:26:21 AM: Starting build script
11:26:21 AM: Installing dependencies
11:26:21 AM: Python version set to 2.7
11:26:22 AM: v16.13.1 is already installed.
11:26:23 AM: Now using node v16.13.1 (npm v8.1.2)
11:26:23 AM: Started restoring cached build plugins
11:26:23 AM: Finished restoring cached build plugins
11:26:23 AM: Attempting ruby version 2.7.2, read from environment
11:26:25 AM: Using ruby version 2.7.2
11:26:25 AM: Using PHP version 8.0
11:26:25 AM: Started restoring cached node modules
11:26:25 AM: Finished restoring cached node modules
11:26:26 AM: Installing NPM modules using NPM version 8.1.2
11:26:29 AM: npm WARN old lockfile
11:26:29 AM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
11:26:29 AM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
11:26:29 AM: npm WARN old lockfile
11:26:29 AM: npm WARN old lockfile This is a one-time fix-up, please be patient...
11:26:29 AM: npm WARN old lockfile
11:26:52 AM: npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
11:26:53 AM: npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
11:26:53 AM: npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
11:27:00 AM: npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
11:27:08 AM: npm WARN deprecated [email protected]: Chokidar 2 will break on node v14 . Upgrade to chokidar 3 with 15x less dependencies.
11:27:10 AM: npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
11:27:11 AM: npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
11:27:14 AM: npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
11:27:17 AM: added 1229 packages, and audited 1230 packages in 50s
11:27:17 AM: 104 packages are looking for funding
11:27:17 AM:   run `npm fund` for details
11:27:17 AM: 15 vulnerabilities (7 moderate, 8 high)
11:27:17 AM: To address issues that do not require attention, run:
11:27:17 AM:   npm audit fix
11:27:17 AM: To address all issues (including breaking changes), run:
11:27:17 AM:   npm audit fix --force
11:27:17 AM: Run `npm audit` for details.
11:27:17 AM: NPM modules installed
11:27:18 AM: Started restoring cached go cache
11:27:18 AM: Finished restoring cached go cache
11:27:18 AM: go version go1.16.5 linux/amd64
11:27:18 AM: go version go1.16.5 linux/amd64
11:27:18 AM: Installing missing commands
11:27:18 AM: Verify run directory
11:27:20 AM: ​
11:27:20 AM: ────────────────────────────────────────────────────────────────
11:27:20 AM:   Netlify Build                                                 
11:27:20 AM: ────────────────────────────────────────────────────────────────
11:27:20 AM: ​
11:27:20 AM: ❯ Version
11:27:20 AM:   @netlify/build 20.3.1
11:27:20 AM: ​
11:27:20 AM: ❯ Flags
11:27:20 AM:   baseRelDir: true
11:27:20 AM:   buildId: 61b9c2c801d254a8c2bc2a45
11:27:20 AM:   deployId: 61b9c2c801d254a8c2bc2a47
11:27:20 AM: ​
11:27:20 AM: ❯ Current directory
11:27:20 AM:   /opt/build/repo
11:27:20 AM: ​
11:27:20 AM: ❯ Config file
11:27:20 AM:   No config file was defined: using default values.
11:27:20 AM: ​
11:27:20 AM: ❯ Context
11:27:20 AM:   production
11:27:20 AM: ​
11:27:20 AM: ────────────────────────────────────────────────────────────────
11:27:20 AM:   1. Build command from Netlify app                             
11:27:20 AM: ────────────────────────────────────────────────────────────────
11:27:20 AM: ​
11:27:20 AM: $ npm run generate
11:27:21 AM: > [email protected] generate
11:27:21 AM: > nuxt generate
11:27:42 AM: [error] [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/bootstrap-vue/src/icons/icons.js as it exceeds the max of 500KB.
11:28:12 AM: [error]  /kontakt
11:28:12 AM: 
11:28:12 AM: TypeError: Cannot read properties of undefined (reading 'title')
11:28:12 AM:     at a.render (pages/kontakt.vue?a191:1:0)
11:28:12 AM:     at a.t._render (/opt/build/repo/node_modules/vue/dist/vue.runtime.common.prod.js:6:35346)
11:28:12 AM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70854
11:28:12 AM:     at eo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67418)
11:28:12 AM:     at oo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70830)
11:28:12 AM:     at no (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70461)
11:28:12 AM:     at to (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67708)
11:28:12 AM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70928
11:28:12 AM:     at eo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67418)
11:28:12 AM:     at oo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70830)
11:28:12 AM:     at no (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70461)
11:28:12 AM:     at to (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67708)
11:28:12 AM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70928
11:28:12 AM:     at eo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67418)
11:28:12 AM:     at oo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70830)
11:28:12 AM:     at no (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70461)
11:28:12 AM: [error]  /om-oss
11:28:12 AM: 
11:28:12 AM: TypeError: Cannot read properties of undefined (reading 'title')
11:28:12 AM:     at a.render (pages/om-oss.vue?bc3a:1:0)
11:28:12 AM:     at a.t._render (/opt/build/repo/node_modules/vue/dist/vue.runtime.common.prod.js:6:35346)
11:28:12 AM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70854
11:28:12 AM:     at eo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67418)
11:28:12 AM:     at oo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70830)
11:28:12 AM:     at no (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70461)
11:28:12 AM:     at to (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67708)
11:28:12 AM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70928
11:28:12 AM:     at eo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67418)
11:28:12 AM:     at oo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70830)
11:28:12 AM:     at no (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70461)
11:28:12 AM:     at to (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67708)
11:28:12 AM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70928
11:28:12 AM:     at eo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67418)
11:28:12 AM:     at oo (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70830)
11:28:12 AM:     at no (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70461)
11:28:12 AM: [error]  /
11:28:12 AM: 
11:28:12 AM: Error: connect ECONNREFUSED 127.0.0.1:80
11:28:12 AM:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
11:28:12 AM: [error] connect ECONNREFUSED 127.0.0.1:80
11:28:12 AM:   at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
11:28:13 AM: ​
11:28:13 AM: (build.command completed in 52.6s)
11:28:13 AM: ​
11:28:13 AM: ────────────────────────────────────────────────────────────────
11:28:13 AM:   2. Deploy site                                                
11:28:13 AM: ────────────────────────────────────────────────────────────────
11:28:13 AM: Starting to deploy site from 'dist'
11:28:13 AM: Creating deploy tree 
11:28:13 AM: ​
11:28:13 AM: Creating deploy upload records
11:28:13 AM: 3 new files to upload
11:28:13 AM: 0 new functions to upload
11:28:13 AM: Site deploy was successfully initiated
11:28:13 AM: ​
11:28:13 AM: (Deploy site completed in 663ms)
11:28:13 AM: ​
11:28:13 AM: ────────────────────────────────────────────────────────────────
11:28:13 AM:   Netlify Build Complete                                        
11:28:13 AM: ────────────────────────────────────────────────────────────────
11:28:13 AM: ​
11:28:13 AM: (Netlify Build completed in 53.5s)
11:28:14 AM: Starting post processing
11:28:14 AM: Post processing - HTML
11:28:14 AM: Caching artifacts
11:28:14 AM: Started saving node modules
11:28:14 AM: Finished saving node modules
11:28:14 AM: Started saving build plugins
11:28:14 AM: Finished saving build plugins
11:28:14 AM: Started saving pip cache
11:28:14 AM: Finished saving pip cache
11:28:14 AM: Started saving emacs cask dependencies
11:28:14 AM: Finished saving emacs cask dependencies
11:28:14 AM: Started saving maven dependencies
11:28:14 AM: Finished saving maven dependencies
11:28:14 AM: Started saving boot dependencies
11:28:14 AM: Finished saving boot dependencies
11:28:14 AM: Started saving rust rustup cache
11:28:14 AM: Finished saving rust rustup cache
11:28:14 AM: Post processing - header rules
11:28:14 AM: Started saving go dependencies
11:28:14 AM: Finished saving go dependencies
11:28:14 AM: Post processing - redirect rules
11:28:14 AM: Post processing done
11:28:14 AM: Site is live ✨
11:28:16 AM: Build script success
11:28:38 AM: Finished processing build request in 2m19.82235889s```

CodePudding user response:

The issue was that you try to deploy with your local server on Netlify. You'll need to deploy the backend too.

  • Related