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.

Calling `$isActive` in library code throws error

See original GitHub issue

bug description When calling $isActive inside an imported library. I get this error:

Failed to init component
<Test>
TypeError: Cannot read property 'params' of null
    at url (../auxcontrol-ui-toolkit/node_modules/@roxi/routify/runtime/helpers.js:213:61)
    at isActive (../auxcontrol-ui-toolkit/node_modules/@roxi/routify/runtime/helpers.js:333:16)
    at instance (eval at <anonymous> (http://localhost:5000/build/index.js:6599:17), <anonymous>:86:15)
    at init (node_modules/svelte/internal/index.mjs:1471:11)
    at new Test (eval at <anonymous> (http://localhost:5000/build/index.js:6599:17), <anonymous>:123:3)
    at createProxiedComponent (node_modules/svelte-hmr/runtime/svelte-hooks.js:206:9)
    at new ProxyComponent (node_modules/svelte-hmr/runtime/proxy.js:237:20)
    at new Proxy<Test> (node_modules/svelte-hmr/runtime/proxy.js:302:11)
    at create_fragment (eval at <anonymous> (http://localhost:5000/build/index.js:16:17), <anonymous>:42:9)
    at init (node_modules/svelte/internal/index.mjs:1486:37)
<Index>
TypeError: Cannot read property 'params' of null
    at url (../auxcontrol-ui-toolkit/node_modules/@roxi/routify/runtime/helpers.js:213:61)
    at isActive (../auxcontrol-ui-toolkit/node_modules/@roxi/routify/runtime/helpers.js:333:16)
    at instance (eval at <anonymous> (http://localhost:5000/build/index.js:6599:17), <anonymous>:86:15)
    at init (node_modules/svelte/internal/index.mjs:1471:11)
    at new Test (eval at <anonymous> (http://localhost:5000/build/index.js:6599:17), <anonymous>:123:3)
    at createProxiedComponent (node_modules/svelte-hmr/runtime/svelte-hooks.js:206:9)
    at new ProxyComponent (node_modules/svelte-hmr/runtime/proxy.js:237:20)
    at new Proxy<Test> (node_modules/svelte-hmr/runtime/proxy.js:302:11)
    at create_fragment (eval at <anonymous> (http://localhost:5000/build/index.js:16:17), <anonymous>:42:9)
    at init (node_modules/svelte/internal/index.mjs:1486:37)
<Noop>
TypeError: Cannot read property 'params' of null
    at url (../auxcontrol-ui-toolkit/node_modules/@roxi/routify/runtime/helpers.js:213:61)
    at isActive (../auxcontrol-ui-toolkit/node_modules/@roxi/routify/runtime/helpers.js:333:16)
    at instance (eval at <anonymous> (http://localhost:5000/build/index.js:6599:17), <anonymous>:86:15)
    at init (node_modules/svelte/internal/index.mjs:1471:11)
    at new Test (eval at <anonymous> (http://localhost:5000/build/index.js:6599:17), <anonymous>:123:3)
    at createProxiedComponent (node_modules/svelte-hmr/runtime/svelte-hooks.js:206:9)
    at new ProxyComponent (node_modules/svelte-hmr/runtime/proxy.js:237:20)
    at new Proxy<Test> (node_modules/svelte-hmr/runtime/proxy.js:302:11)
    at create_fragment (eval at <anonymous> (http://localhost:5000/build/index.js:16:17), <anonymous>:42:9)
    at init (node_modules/svelte/internal/index.mjs:1486:37)

versions Routify: 2.12.5, Svelte: 3.32.3

I checked the “routify” context inside my library and it is the same as in the consuming code.

If you need any more info or if I can help you in any way, feel free to ask. Would be nice to have this work!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jakobrosenbergcommented, Feb 25, 2021

That was a beautiful repo!

1reaction
nicolaiunreincommented, Feb 25, 2021

I will create a minimal repo when I’m at the office

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle error in the calling method - Stack Overflow
Generally speaking, I remember four main ways of handling errors in an application: return values (error codes or booleans), exceptions, ...
Read more >
Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >
How To Handle Errors in a Flask Application - DigitalOcean
In the above code, you first import the Flask class from the flask package. Then you create a Flask application instance called app...
Read more >
LEAF - 1.79.0 - Boost C++ Libraries
Boost LEAF is a lightweight error handling library for C++11. Features: Portable single-header format, no dependencies. Tiny code size when configured for ...
Read more >
Cancellation in coroutines - Medium
Coroutines handle cancellation by throwing a special exception: ... Rather, we need to modify our code and check if the coroutine is active...
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