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.

Error when using v-for in IE10

See original GitHub issue

Version

2.5.16 / 2.5.17

Reproduction link

https://jsfiddle.net/plasmaeng/ndmjjkho/1/

Steps to reproduce

Running the code below in IE10 will result in the following error:

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Page Title</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<script src="vue.js"></script>
</head>
<body>
<div id="app_test">
	<form>
	<select>
		<option v-for="value in L">{{value}}</option>
	</select>
	</form>
</div>

<script>
	var appTest = new Vue({
	el: '#app_test',
		data: {
			L : [ '1', '2' ,'3']
		}
	});
</script>
</body>
</html>

Here is the error message from IE10.

[Vue warn]: Error compiling template:

<div id="app_test">
	<form>
	<select>
		<option v-for="value in L">{{value}}</option>
	</select>
	</form>
</div>

invalid expression: Syntax error in  Raw expression: v-for="value in L"
invalid v-for alias "" in expression: v-for="value in L"

image

image

What is expected?

<option> is generated from 1 to 3.

What is actually happening?

<option> is not generated with error !!!


I have persuaded a senior for a long time to introduce Vue.js. If this problem is solved, we plan to reorganize the site into Vue.js. Please solve the problem.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:26
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

9reactions
symmetriqcommented, May 31, 2018

If you need one of the other fixes in 2.5.16, you can also just patch it yourself.

Search: /([^]*?)\s+(?:in|of)\s+([^]*)/ Replace: /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/

This worked for me, but I decided to revert to 2.5.15 anyway (don’t need any of the other changes in 2.5.16).

4reactions
tfnigelcommented, Oct 3, 2018

Using 2.5.15, fixed it for me; I was seeing the problem on 2.5.17 on IE9.

Read more comments on GitHub >

github_iconTop Results From Across the Web

semicolon error in javascript for loop in internet explorer 10 ...
As you can see from the URL, IE 11 is the lowest version partially supporting let . So you should use var instead....
Read more >
Script errors in Internet Explorer - Browsers - Microsoft Learn
A script error occurs in Internet Explorer, the webpage cannot be displayed correctly and you receive an error message.
Read more >
Syntax error - IE10 - Polyfill - Development Mode #6989 - GitHub
I would see the react svg logo and the default text and background color in IE10, with no script error in IE's dev...
Read more >
JavaScript error in _calculateStaticSize using Internet Explorer ...
Hi there, we noticed a js error which occurs when using Internet Explorer 10. It seems that in the function _calculateStaticSize in the ......
Read more >
Bug and Fix: ASP.NET fails to detect IE10 causing ...
There is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4, namely that they contain definitions for...
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