-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
Description
svelte-cli version 1.0.2
consider the following template:
<input type="text" value="">
when compiling via
svelte compile --format iife helloWorld.html > helloWorld.js
the compiler crashes:
mer@ALANIS:/mnt/d/programming/sveltetest$ svelte compile --format iife helloWorld.html > helloWorld.js
compiling helloWorld.html...
/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/node_modules/svelte/dist/svelte.js:6844
const value = ( attribute.value[0].type === 'Text' ? '' : `"" + ` ) + (
^
TypeError: Cannot read property 'type' of undefined
at node.attributes.forEach.attribute (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/node_modules/svelte/dist/svelte.js:6844:39)
at Array.forEach (native)
at addElementAttributes (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/node_modules/svelte/dist/svelte.js:6772:18)
at Object.enter (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/node_modules/svelte/dist/svelte.js:7034:4)
at visit (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/node_modules/svelte/dist/svelte.js:7512:33)
at Array.forEach (native)
at generate (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/node_modules/svelte/dist/svelte.js:7605:23)
at Object.compile (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/node_modules/svelte/dist/svelte.js:7907:9)
at compileFile (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/bin.js:611:26)
at compile$1 (/home/mer/.nvm/versions/node/v6.3.1/lib/node_modules/svelte-cli/bin.js:576:3)
mer@ALANIS:/mnt/d/programming/sveltetest$
UPDATE:
the compiler does not crash when an additional placeholder for the value attribute is used:
<input type="text" value="{{foo}}">