question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] TypeError: Cannot read properties of null (reading 'trailing_slash')

See original GitHub issue

Hi there,

Currently, I find a replace solution for ReactJS/Vuejs. And i choose Svelte

I use adapter withSvelteKit demo app no any change in code But I get a bug with router

TypeError: Cannot read properties of null (reading 'trailing_slash')
    at respond (file:///project-workspace/svelkit/build/app.js:1285:41)
    at render (file:///project-workspace/svelkit/build/app.js:1720:10)
    at file:///project-workspace/svelkit/build/server.js:73:27
    at async Layer.handle [as handle_request] (https://deno.land/x/opine@1.3.3/src/router/layer.ts:76:5)

Workflow:

  1. Add adapter to svelte.config.js
  2. Build sveltekit with npm run build
  3. Open http://localhost:3000
  4. Click to pages Home, About, Todo workfine
  5. But in /todo page, with a refresh i get a error with trailing_slash

Any reply for fix it?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jpaquimcommented, Sep 1, 2021

Cool! I’ll take a look at your work, when I started I decided to go for opine instead of oak due to it being more Express-like, and being relatively similar in API to the Node adapter’s polka server. But I really like Koa, I need to give oak a try.

As for middleware, it should be possible to add custom opine-compatible middleware in a custom app instance, by overriding the deps.ts file. To make it more flexible, however, it would probably make sense to expose some kind of createServer-like programmatic API, but I guess the main purpose, similar to the Node adapter, is to serve as a baseline implementation of what an adapter/server can look like.

0reactions
und3finedcommented, Jan 14, 2022

Hi @jpaquim Currently, I not focus to Deno, my work focus make Svelte work in golang, support SSR, SSG. Svelte Kit perfect for start, but i want to control server and Svelte as frontend. I completed my first goal, make svelte kit (SSR) run in golang, but more function can’t work. In my mind, the next goal, maybe i’ll make a tool like svelte kit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unintuitive error message when specifying a hostname ...
TypeError : Cannot read property 'replace' of null at new Scope ... that the protocol is optional, but says nothing about the trailing...
Read more >
Cannot read properties of null (reading 'status') using slash ...
I'm using discord.js v13 and I receive the following error when trying to use the member presence to ...
Read more >
"Cannot read property 'trailing_slash' of null" - Support
I have tried to resolve this by adjusting my SvelteKit config using the trailingSlash option. However none of the configurations' options work: Introduction...
Read more >
nock cannot read property 'replace' of null - You.com
The readme specifies that the protocol is optional, but says nothing about the trailing slash. Please excuse me if this is intended behavior...
Read more >
Cannot read property 'node' of undefined Error - Ghost Forum
Other sources told me so far to remove the trailing slash at siteUrl/apiUrl in /gatsby-config.js, src/utils/siteConfig.js and /.ghost.json. I ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found