Почему некоторые ошибки JS во время выполнения не отображаются в консоли?

  • Автор темы swarden
  • 23
  • Обновлено
  • 12, May 2024
  • #1
Привет, В моем приложении Laravel 5.8/vuejs 2.6 я обнаружил ситуации, когда в моей консоли были некоторые ошибки JS во время выполнения.

Эти ошибки не отображаются в консоли, но поток приложений просто остановлен.

Одна из таких ошибок приведена ниже в методе addForumPost:
 $ lsb_release -d; uname -r; uname -i
Description: Ubuntu 18.04.3 LTS
4.15.0-20-generic
x86_64
Google Chrome, Version 77.0.3865.90 (Official Build) (64-bit)
Код (JavaScript): Конечно, строка комментария ниже, и мне нужно использовать this.momentDatetime в
  forumPost.created_at= this.momentDatetime( this.getNowDateTime(), settings_js_moment_datetime_format )
Код (JavaScript): но почему у меня нет ошибки консоли?

 <script> import {bus} from '../../../app'; import appMixin from '../../../appMixin'; import {focus} from 'vue-focus'; import Vue from 'vue'; import {retrieveAppDictionaries, getModalCalculatedHeight, getModalCalculatedWidth} from "../../../helpers/commonFuncs"; import CKEditor from '@ckeditor/ckeditor5-vue'; //[URL='https://lumtu.com/yti/b0hh0bWxodHRwczovL2NrZWRpdG9yLmNvbS9kb2NzL2NrZWRpdG9yNS9sYXRlc3QvYnVpbGRzL2d1aWRlcy9pbnRlZ3JhdGlvbi9mcmFtZXdvcmtzL3Z1ZWpzLmzpW']https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs.html[/URL] import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; Vue.use(CKEditor); export default { data: function () { return { ... } }, name: 'ForumView', directives: {focus: focus}, created() { ... }, // created() { mounted() { ... }, // mounted() { mixins: [appMixin], methods: { addForumPost() { if (this.currentLoggedUser == null || typeof this.currentLoggedUser.id == 'undefined') { this.showPopupMessage("Report abuse", 'You need to login !', 'warn'); return; } if ( this.trim(this.new_thread_post_body) < 5 ) { this.showPopupMessage("Forum Post", 'Your message must be at least 5 chars !', 'warn'); return; } this.message = ''; this.is_page_loaded = false axios.post(window.API_VERSION_LINK + '/forum/add_forum_post', { user_id: this.currentLoggedUser.id, forum_post_body: this.new_thread_post_body, forum_thread_id: this.singleForumThreadRow.id, }).then((response) => { this.is_page_loaded = true let forumPost= response.data.forumPost debugger // THE ROW BELOW stop app flow, but no error in console forumPost.created_at= momentDatetime( this.getNowDateTime(), settings_js_moment_datetime_format ) // forumPost.created_at= this.momentDatetime( this.getNowDateTime(), settings_js_moment_datetime_format ) this.threadPosts.push( forumPost ) this.showPopupMessage("Forum", "Your post was successfully added !", 'success'); ...
Код (разметка): И кажется, это не единственный случай, в некоторых случаях мне приходится шаг за шагом отлаживать, чтобы найти ошибку? Почему так ?

swarden


Рег
06 Dec, 2014

Тем
1

Постов
1

Баллов
11
Тем
49554
Комментарии
57426
Опыт
552966

Интересно