Error when using v-for in IE10
See original GitHub issueVersion
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"
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:
- Created 5 years ago
- Reactions:26
- Comments:22 (8 by maintainers)
Top 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 >
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 Free
Top 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
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).
Using 2.5.15, fixed it for me; I was seeing the problem on 2.5.17 on IE9.