TypeError: Cannot read property 'parts' of undefined
See original GitHub issueMDsveX 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:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just following the basic example, mdsvex preprocessor only
https://github.com/pngwn/sapper-mdsvex-template/blob/master/rollup.config.js
@EmNudge @kuworking are you using any preprocessors?