Failed to execute ‘getRangeAt‘ on ‘Selection‘: 0 is not a valid index.“
const sel = window.getSelection()
range = sel.getRangeAt(0)
The following error message appears when getting the object in the text area selected by the mouse
Solution:
const sel = window.getSelection()
for (let i = 0; i < sel.rangCount; i++) {
range[i] = sel.getRangeAt(i)
}
Read More:
- [Solved] react-router-dom Error: index.js:1 Warning: Functions are not valid as a React child.
- [Solved] Uncaught DOMException: Failed to execute ‘readAsDataURL‘ on ‘FileReader‘: The object is already busy
- Failed to execute ‘setRequestHeader’ on ‘XMLHttpRequest’: String contains non ISO-8859-1 code point.
- “Failed to load resource: net::ERR_FILE_NOT_FOUND” error. The project created by vue-cli 3.0 can run under dev, and an error is reported after packaging, and the page is blank.
- JS async await Error: Uncaught SyntaxError: await is only valid in async functions and the top level bodies of modules
- [Vue warn]: Error in mounted hook: “Error: please transfer a valid prop path to form item“
- Please transfer a valid prop path to form item
- [Vue warn]: Invalid prop: type check failed for prop “index“. Expected String, got Undefined
- [Solved] Error: Incorrect arguments to mysqld_stmt_execute
- [Vue warn]: Invalid prop: custom validator check failed for prop “index“
- [Solved] Failed to load plugin ‘vue‘ declared in ‘.eslintrc.js‘: createRequire is not a function
- Vue project change directory run error:Multiple assets emit different content to the same filename index.html
- [Solved] Invalid prop: type check failed for prop “index“. Expected String, got Undefined
- [Solved] Uniapp project use vant icon Error: (module build failed from./node_modules/postcss loader/SRC/index)
- [Solved] Error in v-on handler: “Error: please transfer a valid prop path to form item
- Using ts-node to Execute .ts files Error [Solved]
- [Vue warn]Error in mounted hook: “Error: please transfer a valid prop path to form item“
- [Solved] Vue uses webpack to package error: Createapp is not a function
- [Solved] Module build failed TypeError this.getOptions is not a function at Object.loader
- The solution that needs alert to execute after using ajax