Home
Support Forums

Un-debuggable error

Every time I push an update to my repo, netlify successfully builds and deploys my website succesfully (according to the log), however when I browse to the URL (or preview the deployment) I receive the following error, which I am finding absolutely impossible to debug:

{"errorType":"TypeError","errorMessage":"Cannot read property 'handle_error' of null","trace":["TypeError: Cannot read property 'handle_error' of null"," at respond (/var/task/index.js:1856:14)"," at render (/var/task/index.js:2181:10)"," at Runtime.handler (/var/task/index.js:2442:26)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]}

Does anyone know how I might go about debugging this issue?

Thanks

Hey there, @digidub :wave:

Welcome to the Netlify Forums! Sorry to hear you are encountering obstacles.

Can you please share your netlify site name, your most recent deploy log, as well as your public repo (if possible)? This will allow us to look into this further.

1 Like

Sure, thanks.
The site name is www.alexcodes.co.uk,

The most recent deploy log is:

2:37:32 PM: Build ready to start
2:37:34 PM: build-image version: 2cee85eb7f808bf3b6e87378c5307f9411f0a332
2:37:34 PM: build-image tag: v3.8.0
2:37:34 PM: buildbot version: fb1691e123b163167156a643d7042e525001587f
2:37:34 PM: Fetching cached dependencies
2:37:34 PM: Starting to download cache of 179.7MB
2:37:36 PM: Finished downloading cache in 1.609493954s
2:37:36 PM: Starting to extract cache
2:37:41 PM: Finished extracting cache in 5.305264015s
2:37:41 PM: Finished fetching cache in 6.967009956s
2:37:41 PM: Starting to prepare the repo for build
2:37:42 PM: Preparing Git Reference refs/heads/master
2:37:42 PM: Parsing package.json dependencies
2:37:43 PM: Starting build script
2:37:43 PM: Installing dependencies
2:37:43 PM: Python version set to 2.7
2:37:43 PM: Started restoring cached node version
2:37:47 PM: Finished restoring cached node version
2:37:48 PM: v14.17.3 is already installed.
2:37:48 PM: Now using node v14.17.3 (npm v6.14.13)
2:37:48 PM: Started restoring cached build plugins
2:37:48 PM: Finished restoring cached build plugins
2:37:49 PM: Attempting ruby version 2.7.2, read from environment
2:37:50 PM: Using ruby version 2.7.2
2:37:50 PM: Using PHP version 5.6
2:37:50 PM: Started restoring cached node modules
2:37:50 PM: Finished restoring cached node modules
2:37:51 PM: Started restoring cached go cache
2:37:51 PM: Finished restoring cached go cache
2:37:51 PM: go version go1.14.4 linux/amd64
2:37:51 PM: go version go1.14.4 linux/amd64
2:37:51 PM: Installing missing commands
2:37:51 PM: Verify run directory
2:37:51 PM: ​
2:37:51 PM: ────────────────────────────────────────────────────────────────
2:37:51 PM:   Netlify Build                                                 
2:37:51 PM: ────────────────────────────────────────────────────────────────
2:37:51 PM: ​
2:37:51 PM: ❯ Version
2:37:51 PM:   @netlify/build 15.1.0
2:37:51 PM: ​
2:37:51 PM: ❯ Flags
2:37:51 PM:   deployId: 60e5ae1ce37dbf000819471e
2:37:51 PM: ​
2:37:51 PM: ❯ Current directory
2:37:51 PM:   /opt/build/repo
2:37:51 PM: ​
2:37:51 PM: ❯ Config file
2:37:51 PM:   /opt/build/repo/netlify.toml
2:37:51 PM: ​
2:37:51 PM: ❯ Context
2:37:51 PM:   production
2:37:51 PM: ​
2:37:51 PM: ────────────────────────────────────────────────────────────────
2:37:51 PM:   1. build.command from netlify.toml                            
2:37:51 PM: ────────────────────────────────────────────────────────────────
2:37:51 PM: ​
2:37:51 PM: $ npm run build
2:37:52 PM: > alex-cox-developer-portfolio@0.0.1 build /opt/build/repo
2:37:52 PM: > svelte-kit build
2:37:52 PM: vite v2.4.1 building for production...
2:37:52 PM: transforming...
2:37:54 PM: βœ“ 33 modules transformed.
2:37:55 PM: rendering chunks...
2:37:56 PM: .svelte-kit/output/client/_app/assets/email.9a46d84e.svg                         0.36kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/phone.1204937f.svg                         0.39kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/info.e907bbcf.svg                          0.41kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/technologies.3cfd85bf.svg                  0.55kb
2:37:56 PM: .svelte-kit/output/client/_app/manifest.json                                     2.92kb
2:37:56 PM: .svelte-kit/output/client/_app/error.svelte-f40c263b.js                          1.55kb / brotli: 0.64kb
2:37:56 PM: .svelte-kit/output/client/_app/pages/__layout.svelte-74be3cb3.js                 3.22kb / brotli: 1.16kb
2:37:56 PM: .svelte-kit/output/client/_app/pages/index.svelte-dd6778bc.js                    3.84kb / brotli: 1.49kb
2:37:56 PM: .svelte-kit/output/client/_app/pages/projects/index.svelte-c107a1b3.js           6.26kb / brotli: 2.18kb
2:37:56 PM: .svelte-kit/output/client/_app/pages/cv/index.svelte-5cfbfe9f.js                 1.53kb / brotli: 0.72kb
2:37:56 PM: .svelte-kit/output/client/_app/pages/contact/index.svelte-32c57bb5.js            2.54kb / brotli: 1.02kb
2:37:56 PM: .svelte-kit/output/client/_app/chunks/paths-45dac81d.js                          0.07kb / brotli: 0.08kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/start-a8cd1609.css                         0.16kb / brotli: 0.10kb
2:37:56 PM: .svelte-kit/output/client/_app/chunks/PageSlide-40582256.js                      0.86kb / brotli: 0.49kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/pages/index.svelte-f29aeb21.css            0.58kb / brotli: 0.15kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/pages/projects/index.svelte-e7083fd7.css   1.11kb / brotli: 0.29kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/pages/contact/index.svelte-192ef3dd.css    0.53kb / brotli: 0.17kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/pages/cv/index.svelte-e8cc6fca.css         0.38kb / brotli: 0.14kb
2:37:56 PM: .svelte-kit/output/client/_app/assets/pages/__layout.svelte-d0fbaf4a.css         1.44kb / brotli: 0.48kb
2:37:56 PM: .svelte-kit/output/client/_app/chunks/vendor-0c60797d.js                         10.14kb / brotli: 3.93kb
2:37:56 PM: .svelte-kit/output/client/_app/start-4d656045.js                                 18.30kb / brotli: 5.71kb
2:37:56 PM: vite v2.4.1 building SSR bundle for production...
2:37:56 PM: transforming...
2:37:57 PM: βœ“ 27 modules transformed.
2:37:57 PM: rendering chunks...
2:37:57 PM: .svelte-kit/output/server/app.js   47.56kb
2:37:57 PM: Run npm run preview to preview your production build locally.
2:37:57 PM: 
2:37:57 PM: > Using @sveltejs/adapter-netlify
2:37:57 PM:   βœ” done
2:37:57 PM: ​
2:37:57 PM: (build.command completed in 5.3s)
2:37:57 PM: ​
2:37:57 PM: ────────────────────────────────────────────────────────────────
2:37:57 PM:   2. Functions bundling                                         
2:37:57 PM: ────────────────────────────────────────────────────────────────
2:37:57 PM: ​
2:37:57 PM: Packaging Functions from functions directory:
2:37:57 PM:  - render/index.js
2:37:57 PM: ​
2:37:58 PM: ​
2:37:58 PM: (Functions bundling completed in 1.1s)
2:37:58 PM: ​
2:37:58 PM: ────────────────────────────────────────────────────────────────
2:37:58 PM:   3. Deploy site                                                
2:37:58 PM: ────────────────────────────────────────────────────────────────
2:37:58 PM: ​
2:37:58 PM: Starting to deploy site from 'build'
2:37:58 PM: Creating deploy tree 
2:37:58 PM: Creating deploy upload records
2:37:58 PM: 10 new files to upload
2:37:58 PM: 1 new functions to upload
2:37:59 PM: Site deploy was successfully initiated
2:37:59 PM: ​
2:37:59 PM: (Deploy site completed in 1.3s)
2:37:59 PM: ​
2:37:59 PM: ────────────────────────────────────────────────────────────────
2:37:59 PM:   Netlify Build Complete                                        
2:37:59 PM: ────────────────────────────────────────────────────────────────
2:37:59 PM: ​
2:37:59 PM: (Netlify Build completed in 7.8s)
2:37:59 PM: Starting post processing
2:37:59 PM: Post processing - HTML
2:37:59 PM: Post processing - header rules
2:37:59 PM: Post processing - redirect rules
2:37:59 PM: Post processing done
2:37:59 PM: Caching artifacts
2:37:59 PM: Started saving node modules
2:37:59 PM: Finished saving node modules
2:37:59 PM: Started saving build plugins
2:37:59 PM: Finished saving build plugins
2:37:59 PM: Started saving pip cache
2:38:00 PM: Site is live ✨
2:38:00 PM: Finished saving pip cache
2:38:00 PM: Started saving emacs cask dependencies
2:38:00 PM: Finished saving emacs cask dependencies
2:38:00 PM: Started saving maven dependencies
2:38:00 PM: Finished saving maven dependencies
2:38:00 PM: Started saving boot dependencies
2:38:00 PM: Finished saving boot dependencies
2:38:00 PM: Started saving rust rustup cache
2:38:00 PM: Finished saving rust rustup cache
2:38:00 PM: Started saving go dependencies
2:38:00 PM: Finished saving go dependencies
2:38:00 PM: Build script success
2:38:27 PM: Finished processing build request in 53.06524322s

The last build version that is working is msater@2860de9 on July 2 at 10:53am.

The public repo is here: GitHub - digidub/portfolio-site

Many thanks

Where are you seeing this error? I visited your website now and the error doesn’t appear in the console at least. Is there a way we could reproduce it?

Sorry, the website appears to work because I published the last working deploy.

I have now published the latest deploy, and if you visit alexcodes.co.uk you will see the error:
https://www.alexcodes.co.uk/

There is no index.html in your published directory. In _redirects there is

/* /.netlify/functions/render 200

It is the render function that is generating the error. This much I have figured out by building and deploying your code. Also in the function error log is

"errorMessage":"Cannot read property 'trailing_slash' of null"

so it might pay to look at Trailing slash with SvelteKit

2 Likes

Hey @digidub

Through a little digging (I’m not a Sveltekit expert) I believe I have found a solution. In your svelte.config.js change

import adapter from '@sveltejs/adapter-netlify';

to

import adapter from '@sveltejs/adapter-static';

(GitHub)

This will generate a static site with an index.html. I built and deployed locally using netlify-cli the output of which you can see at https://sad-murdock-7fcb03.netlify.app (site deleted) rather than using a deploy from GitHub, but I believe it should work that way the same.

1 Like

Thanks. I spent a bit of time trying to solve the issue based on this post but most of it was beyond me. I guess I am still learning. I couldn’t understand why all of a sudden trailing slashes were an issue, when previous deploys had worked.

You are a hero! Thank you so much for helping me. I had previously tried the static adapter and it hadn’t worked, and probably incorrectly assumed I needed to stick with the netlify adapter when deploying to netlify. I’m really pleased to report that the site is now functioning again, you don’t know how much of a headache you have saved me from!

Thanks

1 Like

Curious, persistent, stubborn, yes. Hero, no.

My head hurts! :rofl:

1 Like