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.

TypeError: Cannot read property 'parts' of undefined

See original GitHub issue

MDsveX does not seem to run with Sapper. Have yet to test it with regular svelte. My custom project using it doesn’t work, but works without it. I get the same error with the template: https://github.com/pngwn/sapper-mdsvex-template

Terminal output below:

C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template (master -> origin) (TODO@0.0.1)                                     
λ npm run dev                                                                                                                 
                                                                                                                              
> TODO@0.0.1 dev C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template                                                    
> sapper dev --ext '.svelte .svx'                                                                                             
                                                                                                                              
• client                                                                                                                      
C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\src\node_modules\@sapper\internal\App.svelte                        
'level' is not defined                                                                                                        
22:     <Error {error} {status}/>                                                                                             
23:   {:else}                                                                                                                 
24:     <svelte:component this="{level-Infinity.component}" {...level-Infinity.props}/>                                       
                                 ^                                                                                            
25:   {/if}                                                                                                                   
26: </Layout>                                                                                                                 
C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\src\node_modules\@sapper\internal\App.svelte                        
'level' is not defined                                                                                                        
22:     <Error {error} {status}/>                                                                                             
23:   {:else}                                                                                                                 
24:     <svelte:component this="{level-Infinity.component}" {...level-Infinity.props}/>                                       
                                                                ^                                                             
25:   {/if}                                                                                                                   
26: </Layout>                                                                                                                 
• server                                                                                                                      
C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\src\node_modules\@sapper\internal\App.svelte                        
'level' is not defined                                                                                                        
22:     <Error {error} {status}/>                                                                                             
23:   {:else}                                                                                                                 
24:     <svelte:component this="{level-Infinity.component}" {...level-Infinity.props}/>                                       
                                 ^                                                                                            
25:   {/if}                                                                                                                   
26: </Layout>                                                                                                                 
C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\src\node_modules\@sapper\internal\App.svelte                        
'level' is not defined                                                                                                        
22:     <Error {error} {status}/>                                                                                             
23:   {:else}                                                                                                                 
24:     <svelte:component this="{level-Infinity.component}" {...level-Infinity.props}/>                                       
                                                                ^                                                             
25:   {/if}                                                                                                                   
26: </Layout>                                                                                                                 
✔ service worker (77ms)                                                                                                       
> Listening on http://localhost:3000                                                                                          
(node:1856) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'parts' of undefined                            
    at handle_page (C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:2819:23)        
    at Array.find_route (C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3103:4)    
    at nth_handler (C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3224:14)        
    at C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3224:31                      
    at Array.find_route (C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:699:3)     
    at nth_handler (C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3224:14)        
    at C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3224:31                      
    at Array.<anonymous> (C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3279:4)   
    at nth_handler (C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3224:14)        
    at C:\Users\EmNudge\Workspace\garbage\sapper-mdsvex-template\__sapper__\dev\server\server.js:3224:31                      

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
kuworkingcommented, Sep 19, 2020

@EmNudge @kuworking are you using any preprocessors?

Just following the basic example, mdsvex preprocessor only

https://github.com/pngwn/sapper-mdsvex-template/blob/master/rollup.config.js

0reactions
pngwncommented, Sep 19, 2020

@EmNudge @kuworking are you using any preprocessors?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'Component' of undefined - Stack Overflow
A bit late to this, but this sounds like a typescript error. If anyone else comes across this change import React, {Component} from...
Read more >
Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >
TypeError: Cannot read property 'parts/Globals.js' of undefined ...
Thanks for reporting the issue. As you found out, this is caused by mismatching versions (e.g. Highcharts v7.0 and modules for v7.1) -...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
How to Prevent the Error: Cannot Read Property '0' of Undefined
A guide on how to prevent the error "cannot Read Property '0' of Undefined", covering techniques such as try, catch, using const over...
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