Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message "TypeError: Cannot read property 'start' of undefined" with invalid css #3801

Closed
kjk opened this issue Oct 27, 2019 · 0 comments · Fixed by #3812 or #3818
Closed

Comments

@kjk
Copy link

kjk commented Oct 27, 2019

By mistake I had this invalid css in my component:

<style>
  .no-wrap {
    word-wrap: ;
  }
</style>

With latest 3.12.1 I get the following compilation error:

Running: 'node_modules/.bin/rollup -c -w'
rollup v1.25.0
bundles svelte/main.js → www/gen/bundle.js...
[!] (plugin svelte) TypeError: Cannot read property 'start' of undefined
svelte/GistEditor.svelte
TypeError: Cannot read property 'start' of undefined
    at Declaration$1.minify (/Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/css/Stylesheet.ts:148:21)
    at /Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/css/Stylesheet.ts:32:15
    at Array.forEach (<anonymous>)
    at minify_declarations (/Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/css/Stylesheet.ts:27:15)
    at Rule$1.minify (/Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/css/Stylesheet.ts:92:7)
    at /Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/css/Stylesheet.ts:408:11
    at Array.forEach (<anonymous>)
    at Stylesheet.render (/Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/css/Stylesheet.ts:405:17)
    at dom (/Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/render_dom/index.ts:33:35)
    at render_dom (/Users/kjk/src/codeeval/node_modules/svelte/src/compiler/compile/index.ts:86:6)

I understand this is invalid cs but it's hard to figure out what's wrong from the error message.

Here's a repl: https://svelte.dev/repl/03ce54696b44445fbc8edbfa1c77696c?version=3.12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants