Repository: learningequality/kolibri

Issue:
Kolibri build/complication errors in develop (issue details still being added)
This is a still-being-drafted issue regarding some build and compilation problems on `develop`. 

So far, I have encountered 3 scenarios: 
1) The build works! 
2) Webpack output seems fine and green, but no migrations are printed to the console, and I get a "this site can't be reached" error 
3) `kolibri start --foreground` or `yarn run devserver` sometimes leads to the loading kolibri and `Uncaught ReferenceError: kolibriCoreAppGlobal is not defined`

I have encountered all of these while running `yarn run deverver` -- not just with hot reloading. 

### Logs 

(to be added as I reproduce them) 

<details>
  <summary>Logs when the build works</summary>

```
yarn run devserver
yarn run v1.22.10
$ run-p python-devserver lint-frontend:watch:format hashi-dev watch 

> kolibri-root@0.12.0-dev.1 hashi-dev
> yarn workspace hashi run dev


> kolibri-root@0.12.0-dev.1 lint-frontend:watch:format
> yarn run lint-frontend --monitor --write


> kolibri-root@0.12.0-dev.1 watch
> kolibri-tools build dev --file ./build_tools/build_plugins.txt --cache


> kolibri-root@0.12.0-dev.1 python-devserver
> kolibri start --debug --foreground --port=8000 --settings=kolibri.deployment.default.settings.dev

npm ERR! invalid options argument

npm npmERR! ERR! invalid options argument
 A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-16T19_40_39_124Z-debug.log
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-16T19_40_39_156Z-debug.log
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-16T19_40_39_178Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-16T19_40_39_182Z-debug.log
ERROR: "lint-frontend:watch:format" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ kolibri-tools lint --pattern '{kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}' --ignore '**/dist/**,**/node_modules/**,**/static/**,**/kolibri-core-for-export/**' --monitor --write
$ yarn run build-base --mode=development --watch
$ webpack --config ./webpack.config.js --mode=development --watch
Kolibri Linter: Initializing watcher for the following patterns: {kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}
INFO     Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
INFO     Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
INFO     Option RUN_MODE in section [Deployment] being overridden by environment variable KOLIBRI_RUN_MODE
Gathering relevant modules from ['kolibri.core', 'kolibri.plugins.*']
Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022416-90056-zlmn6f.1wg1.json
INFO: Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022416-90056-zlmn6f.1wg1.json
DEBUG    Distro detected as 'Darwin'
DEBUG    Using '<class 'ifcfg.parser.MacOSXParser'>'
DEBUG    Loaded kolibri plugin: kolibri.core
DEBUG    Loaded kolibri plugin: kolibri.core.auth
DEBUG    Loaded kolibri plugin: kolibri.core.logger
DEBUG    Loaded kolibri plugin: kolibri.core.notifications
DEBUG    Loaded kolibri plugin: kolibri.core.exams
DEBUG    Loaded kolibri plugin: kolibri.core.device
DEBUG    Loaded kolibri plugin: kolibri.core.lessons
INFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.dev
INFO     Version was 0.15.2, new version: 0.16.0.dev0+git.20220516165026
INFO     Running update routines for new version...
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  No migrations to apply.
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  No migrations to apply.
(node:90056) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
(Use `node --trace-deprecation ...` to show where the warning was created)
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  No migrations to apply.
Kolibri Build: Building 'kolibri.core.default_frontend' bundle...
Kolibri Build: Building 'kolibri.core.frontend_head_assets' bundle...
Kolibri Build: Building 'kolibri.plugins.slideshow_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.html5_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.demo_server.main' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.app' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.perseus_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.pdf_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.login_side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.setup_wizard.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.app' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.epub_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.device.app' bundle...
Kolibri Build: Building 'kolibri.plugins.device.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.media_player.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.user_profile_side_nav' bundle...
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:3000/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.1.228:3000/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:3000/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/marcellamaki/Documents/learning-equality/kolibri/public' directory
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  No migrations to apply.
Installed 2 object(s) from 1 fixture(s)
INFO     Detected updates to plugins: kolibri.plugins.perseus_viewer, kolibri.plugins.slideshow_viewer, kolibri.plugins.device, kolibri.plugins.user_profile, kolibri.plugins.user_auth, kolibri.plugins.epub_viewer, kolibri.plugins.setup_wizard, kolibri.plugins.html5_viewer, kolibri.plugins.facility, kolibri.plugins.media_player, kolibri.plugins.coach, kolibri.plugins.default_theme, kolibri.plugins.pdf_viewer, kolibri.plugins.learn
INFO     Running upgrade routines for kolibri.plugins.perseus_viewer, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.perseus_viewer successfully updated
INFO     Running upgrade routines for kolibri.plugins.slideshow_viewer, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.slideshow_viewer successfully updated
INFO     Running upgrade routines for kolibri.plugins.device, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.device successfully updated
INFO     Running upgrade routines for kolibri.plugins.user_profile, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.user_profile successfully updated
INFO     Running upgrade routines for kolibri.plugins.user_auth, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.user_auth successfully updated
INFO     Running upgrade routines for kolibri.plugins.epub_viewer, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.epub_viewer successfully updated
INFO     Running upgrade routines for kolibri.plugins.setup_wizard, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.setup_wizard successfully updated
INFO     Running upgrade routines for kolibri.plugins.html5_viewer, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.html5_viewer successfully updated
INFO     Running upgrade routines for kolibri.plugins.facility, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.facility successfully updated
INFO     Running upgrade routines for kolibri.plugins.media_player, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.media_player successfully updated
INFO     Running upgrade routines for kolibri.plugins.coach, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.coach successfully updated
INFO     Running upgrade routines for kolibri.plugins.default_theme, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.default_theme successfully updated
INFO     Running upgrade routines for kolibri.plugins.pdf_viewer, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.pdf_viewer successfully updated
INFO     Running upgrade routines for kolibri.plugins.learn, upgrading from 0.15.2 to 0.16.0.dev0+git.20220516165026
INFO     kolibri.plugins.learn successfully updated
INFO     Importing 'tasks' module from django apps
DEBUG    Successfully registered 'kolibri.core.auth.tasks.importusersfromcsv' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.exportuserstocsv' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startdataportalsync' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startpeerfacilityimport' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startpeerfacilitysync' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startdeletefacility' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskcontentimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startchannelupdate' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremotechannelimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremotecontentimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskexport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdeletechannel' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremoteimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskchannelimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.channeldiffstats' as job.
DEBUG    Successfully registered 'kolibri.core.logger.tasks.startexportlogcsv' as job.
DEBUG    Successfully registered 'kolibri.plugins.setup_wizard.tasks.startprovisionsoud' as job.
INFO     Starting Kolibri 0.16.0.dev0+git.20220516165026
DEBUG    MiddlewareNotUsed('kolibri.core.analytics.middleware.MetricsMiddleware'): Request profiling is not enabled
INFO     Bus state: ENTER
INFO     Listening for SIGTERM.
INFO     Listening for SIGHUP.
INFO     Listening for SIGUSR1.
INFO     Listening for SIGINT.
INFO     Bus state: IDLE
INFO     Bus state: START
DEBUG    Successfully registered 'kolibri.core.analytics.utils._ping' as job.
INFO     Starting async task workers.
DEBUG    Started new JOBCHECKER thread ID#a557d391f2a440cab2028cbd11a4196b
INFO     Started monitor thread 'ProcessControlPlugin'.
INFO     Started monitor thread 'Autoreloader'.
INFO     Started monitor thread 'ZeroConfPlugin'.
INFO     Starting on 0.0.0.0:8000
DEBUG    Pingback data: {'instance_id': '2c0341bf62828f224eb0b37bf673fee3', 'version': '0.16.0.dev0+git.20220516165026', 'mode': 'marcella', 'project': '', 'platform': 'macOS-11.6.5-x86_64-i386-64bit', 'sysversion': '3.8.2 (default, Dec 21 2020, 15:06:04) \n[Clang 12.0.0 (clang-1200.0.32.29)]', 'database_id': 'bc6500640fc8476e987c5dc79d678bc3', 'system_id': '95c749810401346f5248', 'node_id': 'd7eff00f69bf75f4cdef', 'language': 'en', 'timezone': 'America/New_York', 'uptime': 0, 'timestamp': datetime.datetime(2022, 5, 16, 15, 40, 45, 153872, tzinfo=<DstTzInfo 'America/New_York' EDT-1 day, 20:00:00 DST>), 'installer': 'whl'}
DEBUG    Starting new HTTPS connection (1): telemetry.learningequality.org:443
INFO     Waiting for 0.0.0.0:8000
INFO     Serving on 0.0.0.0:8000
DEBUG    Successfully registered 'kolibri.core.public.utils.soud_sync_cleanup' as job.
INFO     Registering ourselves to zeroconf network with id '2c0341bf62828f224eb0b37bf673fee3' and port '8000'
DEBUG    https://telemetry.learningequality.org:443 "POST /api/v1/pingback HTTP/1.1" 200 41
INFO     Ping succeeded! (response: {'id': 2672358, 'messages': []})
DEBUG    Statistics data: {'pi': 2672358, 'c': [{'ci': '95a52b386f', 'v': 103, 'u': '2022-04-21', 'pi': ['5d6c9ac890', '8ee90d0bff', '1daebd899c'], 'pc': [21, 4, 1], 's': 306.09996604919434, 'ss': 3, 'sc': 1, 'sk': {'document': 26}, 'suc': 26, 'sac': 0, 'sacnv': 0, 'sut': 6, 'sat': 0, 'uwl': 1, 'vwl': 0, 'dsl': {}, 'dsnl': {}}, {'ci': '000409f81d', 'v': 7, 'u': '2022-04-21', 'pi': ['f5a7e2bd53'], 'pc': [1], 's': 264.8808298110962, 'ss': 1, 'sc': 0, 'sk': {'video': 1}, 'suc': 1, 'sac': 0, 'sacnv': 0, 'sut': 0, 'sat': 0, 'uwl': 1, 'vwl': 0, 'dsl': {}, 'dsnl': {}}], 'f': [{'fi': 'nQ18LADyom', 's': {'preset': 'informal', 'learner_can_edit_username': True, 'learner_can_edit_name': True, 'learner_can_edit_password': True, 'learner_can_sign_up': True, 'learner_can_delete_account': True, 'learner_can_login_with_no_password': False, 'show_download_button_in_learn': True, 'registered': False, 'allow_guest_access': True}, 'lc': 0, 'llc': 0, 'cc': 1, 'clc': 37, 'uwl': 1, 'vwl': 0, 'dis': {'Mac OS,10/Chrome,100': 6, 'Mac OS,10/Chrome,101': 28, 'Mac OS,10/Firefox,98': 2, 'Mac OS,10/WebKit,605': 1}, 'f': '2022-04-21', 'l': '2022-05-16', 'ss': 4, 'sc': 1, 'sk': {'document': 26, 'video': 1}, 'crc': 1, 'grc': 0, 'lec': 1, 'ec': 1, 'elc': 0, 'alc': 0, 'ealc': 0, 'suc': 27, 'sac': 0, 'sacnv': 0, 'sut': 6, 'sat': 0, 'dsl': {}, 'dsnl': {}}]}
DEBUG    Starting new HTTPS connection (1): telemetry.learningequality.org:443
DEBUG    https://telemetry.learningequality.org:443 "POST /api/v1/statistics HTTP/1.1" 200 22
INFO     Kolibri running on: http://192.168.1.228:8000/
INFO     Kolibri running on: http://127.0.0.1:8000/
INFO     Starting on 0.0.0.0:0
INFO     Waiting for 0.0.0.0:56198
INFO     Serving on 0.0.0.0:56198
INFO     Bus state: RUN
INFO     Updating ourselves to zeroconf network with id '2c0341bf62828f224eb0b37bf673fee3' and port '8000'
assets by status 948 KiB [cached] 4 assets
runtime modules 8.93 KiB 14 modules
orphan modules 15.9 KiB [orphan] 10 modules
javascript modules 668 KiB
  modules by path ./ 372 KiB
    modules by path ./node_modules/core-js/ 172 KiB 157 modules
    modules by path ./src/ 197 KiB 19 modules
    modules by path ./node_modules/uuid/dist/esm-browser/*.js 3.24 KiB 5 modules
  modules by path ../../node_modules/ 296 KiB
    modules by path ../../node_modules/lodash/*.js 126 KiB 163 modules
    modules by path ../../node_modules/toposort-class/ 7.96 KiB 2 modules
json modules 1.12 KiB
  ./h5p_build.json 66 bytes [built] [code generated]
  ./src/mimetypes.json 1.05 KiB [built] [code generated]
webpack 5.32.0 compiled successfully in 7064 ms
Kolibri Build: Completed 'kolibri.core.frontend_head_assets' bundle in 14.473s!
Kolibri Build: Completed 'kolibri.plugins.user_profile.user_profile_side_nav' bundle in 14.779s!
Kolibri Build: Completed 'kolibri.plugins.coach.side_nav' bundle in 14.815s!
Kolibri Build: Completed 'kolibri.plugins.device.side_nav' bundle in 14.819s!
Kolibri Build: Completed 'kolibri.plugins.facility.side_nav' bundle in 14.86s!
Kolibri Build: Completed 'kolibri.plugins.learn.side_nav' bundle in 15.175s!
Kolibri Build: Completed 'kolibri.plugins.user_auth.login_side_nav' bundle in 16.69s!
Kolibri Build: Completed 'kolibri.plugins.demo_server.main' bundle in 16.747s!
Kolibri Build: Completed 'kolibri.plugins.user_profile.app' bundle in 23.155s!
Kolibri Build: Completed 'kolibri.plugins.user_auth.app' bundle in 31.058s!
Kolibri Build: Completed 'kolibri.plugins.perseus_viewer.main' bundle in 31.226s!
Kolibri Build: Completed 'kolibri.plugins.slideshow_viewer.main' bundle in 35.594s!
Kolibri Build: Completed 'kolibri.plugins.device.app' bundle in 36.673s!
Kolibri Build: Completed 'kolibri.plugins.html5_viewer.main' bundle in 37.398s!
Kolibri Build: Completed 'kolibri.plugins.setup_wizard.app' bundle in 42.115s!
Kolibri Build: Completed 'kolibri.plugins.pdf_viewer.main' bundle in 42.3s!
Kolibri Build: Completed 'kolibri.plugins.epub_viewer.main' bundle in 47.034s!
Kolibri Build: Completed 'kolibri.plugins.media_player.main' bundle in 50.107s!
Kolibri Build: Completed 'kolibri.plugins.facility.app' bundle in 52.926s!
Kolibri Build: Completed 'kolibri.plugins.coach.app' bundle in 56.341s!
Kolibri Build: Completed 'kolibri.plugins.learn.app' bundle in 61.944s!
Kolibri Build: Completed 'kolibri.core.default_frontend' bundle in 70.304s!
Kolibri Build: Build complete
INFO     127.0.0.1 - - "GET /en/learn/" 200 0 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
INFO     127.0.0.1 - - "PUT /api/auth/session/current/" 200 0 "http://127.0.0.1:8000/en/learn/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
INFO     127.0.0.1 - - "GET /learn/api/state" 200 0 "http://127.0.0.1:8000/en/learn/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
INFO     127.0.0.1 - - "GET /en/auth/" 200 0 "http://127.0.0.1:8000/en/learn/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
```

</details>

<details>
  <summary>Logs when webpack doesn't error, but "This site can't be reached"</summary>


**CONTEXT**: when moving from release-v0.15.x to my first working branch (off of develop) for the day, there were no problems. Then from switching from working branch A, to working branch B, I did the following: 

```
kill -9 $(pgrep -f kolibri) // ensure no kolibris are still running
pip install -r requirements.txt --upgrade
pip install -r requirements/dev.txt --upgrade
pip install -e .
yarn install
yarn run devserver
``` 
Which resulted in:

```

yarn run v1.22.10
$ run-p python-devserver lint-frontend:watch:format hashi-dev watch 

> kolibri-root@0.12.0-dev.1 python-devserver
> kolibri start --debug --foreground --port=8000 --settings=kolibri.deployment.default.settings.dev


> kolibri-root@0.12.0-dev.1 lint-frontend:watch:format
> yarn run lint-frontend --monitor --write


> kolibri-root@0.12.0-dev.1 hashi-dev
> yarn workspace hashi run dev


> kolibri-root@0.12.0-dev.1 watch
> kolibri-tools build dev --file ./build_tools/build_plugins.txt --cache

npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_34_53_810Z-debug.log
npm ERR! invalid options argument
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_34_53_856Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_34_53_869Z-debug.log
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_34_53_927Z-debug.log
ERROR: "lint-frontend:watch:format" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ kolibri-tools lint --pattern '{kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}' --ignore '**/dist/**,**/node_modules/**,**/static/**,**/kolibri-core-for-export/**' --monitor --write
$ yarn run build-base --mode=development --watch
$ webpack --config ./webpack.config.js --mode=development --watch
Kolibri Linter: Initializing watcher for the following patterns: {kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}
Gathering relevant modules from ['kolibri.core', 'kolibri.plugins.*']
Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022423-34072-19qmz24.nyi8.json
INFO: Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022423-34072-19qmz24.nyi8.json
(node:34072) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
(Use `node --trace-deprecation ...` to show where the warning was created)
Kolibri Build: Building 'kolibri.core.default_frontend' bundle...
Kolibri Build: Building 'kolibri.core.frontend_head_assets' bundle...
Kolibri Build: Building 'kolibri.plugins.slideshow_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.html5_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.demo_server.main' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.app' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.perseus_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.pdf_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.login_side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.setup_wizard.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.app' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.epub_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.device.app' bundle...
Kolibri Build: Building 'kolibri.plugins.device.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.media_player.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.user_profile_side_nav' bundle...
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:3000/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.1.228:3000/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:3000/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/marcellamaki/Documents/learning-equality/kolibri/public' directory
assets by status 948 KiB [cached] 4 assets
runtime modules 8.93 KiB 14 modules
orphan modules 15.9 KiB [orphan] 10 modules
javascript modules 668 KiB
  modules by path ./ 372 KiB
    modules by path ./node_modules/core-js/ 172 KiB 157 modules
    modules by path ./src/ 197 KiB 19 modules
    modules by path ./node_modules/uuid/dist/esm-browser/*.js 3.24 KiB 5 modules
  modules by path ../../node_modules/ 296 KiB
    modules by path ../../node_modules/lodash/*.js 126 KiB 163 modules
    modules by path ../../node_modules/toposort-class/ 7.96 KiB 2 modules
json modules 1.12 KiB
  ./h5p_build.json 66 bytes [built] [code generated]
  ./src/mimetypes.json 1.05 KiB [built] [code generated]
webpack 5.32.0 compiled successfully in 6124 ms
Kolibri Build: Completed 'kolibri.core.frontend_head_assets' bundle in 10.992s!
Kolibri Build: Completed 'kolibri.plugins.device.side_nav' bundle in 10.977s!
Kolibri Build: Completed 'kolibri.plugins.demo_server.main' bundle in 11.034s!
Kolibri Build: Completed 'kolibri.plugins.user_profile.user_profile_side_nav' bundle in 11.109s!
Kolibri Build: Completed 'kolibri.plugins.user_auth.login_side_nav' bundle in 11.141s!
Kolibri Build: Completed 'kolibri.plugins.facility.side_nav' bundle in 11.149s!
Kolibri Build: Completed 'kolibri.plugins.learn.side_nav' bundle in 11.325s!
Kolibri Build: Completed 'kolibri.plugins.coach.side_nav' bundle in 11.364s!
Kolibri Build: Completed 'kolibri.plugins.facility.app' bundle in 13.098s!
Kolibri Build: Completed 'kolibri.plugins.media_player.main' bundle in 14.939s!
Kolibri Build: Completed 'kolibri.plugins.user_auth.app' bundle in 15.097s!
Kolibri Build: Completed 'kolibri.plugins.pdf_viewer.main' bundle in 17.514s!
Kolibri Build: Completed 'kolibri.plugins.device.app' bundle in 19.356s!
Kolibri Build: Completed 'kolibri.plugins.user_profile.app' bundle in 21.258s!
Kolibri Build: Completed 'kolibri.plugins.epub_viewer.main' bundle in 21.427s!
Kolibri Build: Completed 'kolibri.plugins.slideshow_viewer.main' bundle in 22.997s!
Kolibri Build: Completed 'kolibri.plugins.perseus_viewer.main' bundle in 23.032s!
Kolibri Build: Completed 'kolibri.plugins.coach.app' bundle in 25.923s!
Kolibri Build: Completed 'kolibri.plugins.html5_viewer.main' bundle in 28.842s!
Kolibri Build: Completed 'kolibri.plugins.setup_wizard.app' bundle in 30.492s!
Kolibri Build: Completed 'kolibri.plugins.learn.app' bundle in 32.702s!
Kolibri Build: Completed 'kolibri.core.default_frontend' bundle in 37.49s!
Kolibri Build: Build complete

```

</details>

<details>
  <summary>Logs for `Uncaught ReferenceError: kolibriCoreAppGlobal is not defined`</summary>


**CONTEXT**: After the series of steps above, I once again did `kill -9 $(pgrep -f kolibri)` and then `yarn run devserver`, resulting in: 

``` 
yarn run devserver
yarn run v1.22.10
$ run-p python-devserver lint-frontend:watch:format hashi-dev watch 

> kolibri-root@0.12.0-dev.1 watch
> kolibri-tools build dev --file ./build_tools/build_plugins.txt --cache


> kolibri-root@0.12.0-dev.1 hashi-dev
> yarn workspace hashi run dev


> kolibri-root@0.12.0-dev.1 python-devserver
> kolibri start --debug --foreground --port=8000 --settings=kolibri.deployment.default.settings.dev


> kolibri-root@0.12.0-dev.1 lint-frontend:watch:format
> yarn run lint-frontend --monitor --write

npm ERR! invalid options argument
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_43_36_770Z-debug.log
npm ERR! invalid options argument
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_43_36_774Z-debug.log
$ kolibri-tools lint --pattern '{kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}' --ignore '**/dist/**,**/node_modules/**,**/static/**,**/kolibri-core-for-export/**' --monitor --write

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_43_36_798Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_43_36_807Z-debug.log
ERROR: "watch" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ yarn run build-base --mode=development --watch
$ webpack --config ./webpack.config.js --mode=development --watch
INFO     Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
INFO     Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
INFO     Option RUN_MODE in section [Deployment] being overridden by environment variable KOLIBRI_RUN_MODE
Kolibri Linter: Initializing watcher for the following patterns: {kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}
DEBUG    Distro detected as 'Darwin'
DEBUG    Using '<class 'ifcfg.parser.MacOSXParser'>'
DEBUG    Loaded kolibri plugin: kolibri.core
Gathering relevant modules from ['kolibri.core', 'kolibri.plugins.*']
Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022423-34398-1f6a01k.u52wi.json
INFO: Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022423-34398-1f6a01k.u52wi.json
DEBUG    Loaded kolibri plugin: kolibri.core.auth
DEBUG    Loaded kolibri plugin: kolibri.core.logger
DEBUG    Loaded kolibri plugin: kolibri.core.notifications
DEBUG    Loaded kolibri plugin: kolibri.core.exams
DEBUG    Loaded kolibri plugin: kolibri.core.device
DEBUG    Loaded kolibri plugin: kolibri.core.lessons
INFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.dev
INFO     Version was 0.16.0.dev0+git.20220511193318, new version: 0.16.0.dev0+git.20220504153424
INFO     Running update routines for new version...
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  No migrations to apply.
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  No migrations to apply.
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  No migrations to apply.
Operations to perform:
  Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
(node:34398) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
(Use `node --trace-deprecation ...` to show where the warning was created)
Running migrations:
  No migrations to apply.
Kolibri Build: Building 'kolibri.core.default_frontend' bundle...
Kolibri Build: Building 'kolibri.core.frontend_head_assets' bundle...
Kolibri Build: Building 'kolibri.plugins.slideshow_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.html5_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.demo_server.main' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.app' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.perseus_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.pdf_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.login_side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.setup_wizard.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.app' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.epub_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.device.app' bundle...
Kolibri Build: Building 'kolibri.plugins.device.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.media_player.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.user_profile_side_nav' bundle...
/Users/marcellamaki/Documents/learning-equality/kolibri/node_modules/webpack-dev-server/lib/Server.js:2434
        throw error;
        ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:3000
    at Server.setupListenHandle [as _listen2] (node:net:1334:16)
    at listenInCluster (node:net:1382:12)
    at doListen (node:net:1520:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21) {
  code: 'EADDRINUSE',
  errno: -48,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 3000
}
Installed 2 object(s) from 1 fixture(s)
INFO     Detected updates to plugins: kolibri.plugins.html5_viewer, kolibri.plugins.user_auth, kolibri.plugins.pdf_viewer, kolibri.plugins.device, kolibri.plugins.default_theme, kolibri.plugins.perseus_viewer, kolibri.plugins.coach, kolibri.plugins.media_player, kolibri.plugins.facility, kolibri.plugins.slideshow_viewer, kolibri.plugins.epub_viewer, kolibri.plugins.learn, kolibri.plugins.setup_wizard, kolibri.plugins.user_profile
INFO     Running downgrade routines for kolibri.plugins.html5_viewer, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.html5_viewer successfully updated
INFO     Running downgrade routines for kolibri.plugins.user_auth, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.user_auth successfully updated
INFO     Running downgrade routines for kolibri.plugins.pdf_viewer, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.pdf_viewer successfully updated
INFO     Running downgrade routines for kolibri.plugins.device, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.device successfully updated
INFO     Running downgrade routines for kolibri.plugins.default_theme, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.default_theme successfully updated
INFO     Running downgrade routines for kolibri.plugins.perseus_viewer, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.perseus_viewer successfully updated
INFO     Running downgrade routines for kolibri.plugins.coach, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.coach successfully updated
INFO     Running downgrade routines for kolibri.plugins.media_player, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.media_player successfully updated
INFO     Running downgrade routines for kolibri.plugins.facility, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.facility successfully updated
INFO     Running downgrade routines for kolibri.plugins.slideshow_viewer, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.slideshow_viewer successfully updated
INFO     Running downgrade routines for kolibri.plugins.epub_viewer, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.epub_viewer successfully updated
INFO     Running downgrade routines for kolibri.plugins.learn, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.learn successfully updated
INFO     Running downgrade routines for kolibri.plugins.setup_wizard, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.setup_wizard successfully updated
INFO     Running downgrade routines for kolibri.plugins.user_profile, downgrading from 0.16.0.dev0+git.20220511193318 to 0.16.0.dev0+git.20220504153424
INFO     kolibri.plugins.user_profile successfully updated
INFO     Importing 'tasks' module from django apps
DEBUG    Successfully registered 'kolibri.core.auth.tasks.importusersfromcsv' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.exportuserstocsv' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startdataportalsync' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startpeerfacilityimport' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startpeerfacilitysync' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startdeletefacility' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskcontentimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startchannelupdate' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremotechannelimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremotecontentimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskexport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdeletechannel' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremoteimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskchannelimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.channeldiffstats' as job.
DEBUG    Successfully registered 'kolibri.core.logger.tasks.startexportlogcsv' as job.
DEBUG    Successfully registered 'kolibri.plugins.setup_wizard.tasks.startprovisionsoud' as job.
INFO     Starting Kolibri 0.16.0.dev0+git.20220504153424
DEBUG    MiddlewareNotUsed('kolibri.core.analytics.middleware.MetricsMiddleware'): Request profiling is not enabled
INFO     Bus state: ENTER
INFO     Listening for SIGTERM.
INFO     Listening for SIGHUP.
INFO     Listening for SIGUSR1.
INFO     Listening for SIGINT.
INFO     Bus state: IDLE
INFO     Bus state: START
DEBUG    Successfully registered 'kolibri.core.analytics.utils._ping' as job.
INFO     Starting async task workers.
DEBUG    Started new JOBCHECKER thread ID#e87735d58feb4bb296dd1232d72b01b6
INFO     Started monitor thread 'ZeroConfPlugin'.
INFO     Started monitor thread 'Autoreloader'.
INFO     Started monitor thread 'ProcessControlPlugin'.
INFO     Starting on 0.0.0.0:8000
DEBUG    Pingback data: {'instance_id': '2c0341bf62828f224eb0b37bf673fee3', 'version': '0.16.0.dev0+git.20220504153424', 'mode': 'marcella', 'project': '', 'platform': 'macOS-11.6.5-x86_64-i386-64bit', 'sysversion': '3.8.2 (default, Dec 21 2020, 15:06:04) \n[Clang 12.0.0 (clang-1200.0.32.29)]', 'database_id': 'bc6500640fc8476e987c5dc79d678bc3', 'system_id': '95c749810401346f5248', 'node_id': 'd7eff00f69bf75f4cdef', 'language': 'en', 'timezone': 'America/New_York', 'uptime': 0, 'timestamp': datetime.datetime(2022, 5, 23, 15, 43, 41, 102294, tzinfo=<DstTzInfo 'America/New_York' EDT-1 day, 20:00:00 DST>), 'installer': 'whl'}
INFO     Waiting for 0.0.0.0:8000
INFO     Serving on 0.0.0.0:8000
DEBUG    Starting new HTTPS connection (1): telemetry.learningequality.org:443
DEBUG    Successfully registered 'kolibri.core.public.utils.soud_sync_cleanup' as job.
INFO     Registering ourselves to zeroconf network with id '2c0341bf62828f224eb0b37bf673fee3' and port '8000'
DEBUG    https://telemetry.learningequality.org:443 "POST /api/v1/pingback HTTP/1.1" 200 41
INFO     Ping succeeded! (response: {'id': 2689046, 'messages': []})
DEBUG    Statistics data: {'pi': 2689046, 'c': [{'ci': '95a52b386f', 'v': 103, 'u': '2022-04-21', 'pi': ['55927a7cd4', '5d6c9ac890', '682e09992e', '8ee90d0bff', '1daebd899c'], 'pc': [138, 21, 13, 4, 1], 's': 306.09996604919434, 'ss': 5, 'sc': 3, 'sk': {'document': 26, 'video': 151}, 'suc': 177, 'sac': 0, 'sacnv': 0, 'sut': 19, 'sat': 0, 'uwl': 1, 'vwl': 0, 'dsl': {}, 'dsnl': {}}, {'ci': '000409f81d', 'v': 7, 'u': '2022-04-21', 'pi': ['f5a7e2bd53'], 'pc': [22], 's': 264.8808298110962, 'ss': 1, 'sc': 1, 'sk': {'video': 22}, 'suc': 20, 'sac': 2, 'sacnv': 0, 'sut': 1, 'sat': 0, 'uwl': 1, 'vwl': 1, 'dsl': {}, 'dsnl': {}}], 'f': [{'fi': 'nQ18LADyom', 's': {'preset': 'informal', 'learner_can_edit_username': True, 'learner_can_edit_name': True, 'learner_can_edit_password': True, 'learner_can_sign_up': True, 'learner_can_delete_account': True, 'learner_can_login_with_no_password': False, 'show_download_button_in_learn': True, 'registered': False, 'allow_guest_access': True}, 'lc': 1, 'llc': 4, 'cc': 2, 'clc': 69, 'uwl': 1, 'vwl': 1, 'dis': {'Mac OS,10/Chrome,100': 6, 'Mac OS,10/Chrome,101': 64, 'Mac OS,10/Firefox,98': 2, 'Mac OS,10/WebKit,605': 1}, 'f': '2022-04-21', 'l': '2022-05-23', 'ss': 6, 'sc': 4, 'sk': {'document': 26, 'video': 173}, 'crc': 1, 'grc': 0, 'lec': 1, 'ec': 1, 'elc': 0, 'alc': 0, 'ealc': 0, 'suc': 197, 'sac': 2, 'sacnv': 0, 'sut': 20, 'sat': 0, 'dsl': {}, 'dsnl': {}}]}
DEBUG    Starting new HTTPS connection (1): telemetry.learningequality.org:443
DEBUG    https://telemetry.learningequality.org:443 "POST /api/v1/statistics HTTP/1.1" 200 22
INFO     Kolibri running on: http://127.0.0.1:8000/
INFO     Kolibri running on: http://192.168.1.228:8000/
INFO     Starting on 0.0.0.0:0
INFO     Waiting for 0.0.0.0:51642
INFO     Serving on 0.0.0.0:51642
INFO     Bus state: RUN
INFO     Updating ourselves to zeroconf network with id '2c0341bf62828f224eb0b37bf673fee3' and port '8000'
assets by status 948 KiB [cached] 4 assets
runtime modules 8.93 KiB 14 modules
orphan modules 15.9 KiB [orphan] 10 modules
javascript modules 668 KiB
  modules by path ./ 372 KiB
    modules by path ./node_modules/core-js/ 172 KiB 157 modules
    modules by path ./src/ 197 KiB 19 modules
    modules by path ./node_modules/uuid/dist/esm-browser/*.js 3.24 KiB 5 modules
  modules by path ../../node_modules/ 296 KiB
    modules by path ../../node_modules/lodash/*.js 126 KiB 163 modules
    modules by path ../../node_modules/toposort-class/ 7.96 KiB 2 modules
json modules 1.12 KiB
  ./h5p_build.json 66 bytes [built] [code generated]
  ./src/mimetypes.json 1.05 KiB [built] [code generated]
webpack 5.32.0 compiled successfully in 4624 ms
INFO     127.0.0.1 - - "GET /en/learn/" 200 0 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"

```
</details>


<details>
  <summary>Logs for  when it starts working again after errors </summary>

```
yarn run devserver
yarn run v1.22.10
$ run-p python-devserver lint-frontend:watch:format hashi-dev watch 

> kolibri-root@0.12.0-dev.1 lint-frontend:watch:format
> yarn run lint-frontend --monitor --write


> kolibri-root@0.12.0-dev.1 hashi-dev
> yarn workspace hashi run dev


> kolibri-root@0.12.0-dev.1 watch
> kolibri-tools build dev --file ./build_tools/build_plugins.txt --cache


> kolibri-root@0.12.0-dev.1 python-devserver
> kolibri start --debug --foreground --port=8000 --settings=kolibri.deployment.default.settings.dev

$ kolibri-tools lint --pattern '{kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}' --ignore '**/dist/**,**/node_modules/**,**/static/**,**/kolibri-core-for-export/**' --monitor --write
npm ERR! invalid options argument
npm ERR! invalid options argument
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_49_19_707Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_49_19_683Z-debug.log
 A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_49_19_726Z-debug.log
npm ERR! invalid options argument

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marcellamaki/.npm/_logs/2022-05-23T19_49_19_777Z-debug.log
ERROR: "watch" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ yarn run build-base --mode=development --watch
$ webpack --config ./webpack.config.js --mode=development --watch
INFO     Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
INFO     Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
INFO     Option RUN_MODE in section [Deployment] being overridden by environment variable KOLIBRI_RUN_MODE
Kolibri Linter: Initializing watcher for the following patterns: {kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}
DEBUG    Distro detected as 'Darwin'
DEBUG    Using '<class 'ifcfg.parser.MacOSXParser'>'
DEBUG    Loaded kolibri plugin: kolibri.core
Gathering relevant modules from ['kolibri.core', 'kolibri.plugins.*']
Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022423-34503-186vlq4.s5ch.json
INFO: Writing webpack_json output to /var/folders/9g/tky_78fs63j2sly2ddzfbc2h0000gn/T/2022423-34503-186vlq4.s5ch.json
DEBUG    Loaded kolibri plugin: kolibri.core.auth
DEBUG    Loaded kolibri plugin: kolibri.core.logger
DEBUG    Loaded kolibri plugin: kolibri.core.notifications
DEBUG    Loaded kolibri plugin: kolibri.core.exams
DEBUG    Loaded kolibri plugin: kolibri.core.device
DEBUG    Loaded kolibri plugin: kolibri.core.lessons
INFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.dev
INFO     Importing 'tasks' module from django apps
DEBUG    Successfully registered 'kolibri.core.auth.tasks.importusersfromcsv' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.exportuserstocsv' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startdataportalsync' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startpeerfacilityimport' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startpeerfacilitysync' as job.
DEBUG    Successfully registered 'kolibri.core.auth.tasks.startdeletefacility' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskcontentimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startchannelupdate' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremotechannelimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremotecontentimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskexport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdeletechannel' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startremoteimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.startdiskchannelimport' as job.
DEBUG    Successfully registered 'kolibri.core.content.tasks.channeldiffstats' as job.
DEBUG    Successfully registered 'kolibri.core.logger.tasks.startexportlogcsv' as job.
DEBUG    Successfully registered 'kolibri.plugins.setup_wizard.tasks.startprovisionsoud' as job.
INFO     Starting Kolibri 0.16.0.dev0+git.20220504153424
DEBUG    MiddlewareNotUsed('kolibri.core.analytics.middleware.MetricsMiddleware'): Request profiling is not enabled
INFO     Bus state: ENTER
INFO     Listening for SIGTERM.
INFO     Listening for SIGHUP.
INFO     Listening for SIGUSR1.
INFO     Listening for SIGINT.
INFO     Bus state: IDLE
INFO     Bus state: START
DEBUG    Successfully registered 'kolibri.core.analytics.utils._ping' as job.
INFO     Starting async task workers.
DEBUG    Started new JOBCHECKER thread ID#a3d11555b25e43a7b259868e6b53a369
INFO     Started monitor thread 'Autoreloader'.
INFO     Started monitor thread 'ZeroConfPlugin'.
INFO     Started monitor thread 'ProcessControlPlugin'.
INFO     Starting on 0.0.0.0:8000
INFO     Waiting for 0.0.0.0:8000
INFO     Serving on 0.0.0.0:8000
DEBUG    Successfully registered 'kolibri.core.public.utils.soud_sync_cleanup' as job.
INFO     Registering ourselves to zeroconf network with id '2c0341bf62828f224eb0b37bf673fee3' and port '8000'
(node:34503) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
(Use `node --trace-deprecation ...` to show where the warning was created)
Kolibri Build: Building 'kolibri.core.default_frontend' bundle...
Kolibri Build: Building 'kolibri.core.frontend_head_assets' bundle...
Kolibri Build: Building 'kolibri.plugins.slideshow_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.html5_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.demo_server.main' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.app' bundle...
Kolibri Build: Building 'kolibri.plugins.learn.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.perseus_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.pdf_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_auth.login_side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.setup_wizard.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.app' bundle...
Kolibri Build: Building 'kolibri.plugins.facility.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.app' bundle...
Kolibri Build: Building 'kolibri.plugins.coach.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.epub_viewer.main' bundle...
Kolibri Build: Building 'kolibri.plugins.device.app' bundle...
Kolibri Build: Building 'kolibri.plugins.device.side_nav' bundle...
Kolibri Build: Building 'kolibri.plugins.media_player.main' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.app' bundle...
Kolibri Build: Building 'kolibri.plugins.user_profile.user_profile_side_nav' bundle...
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:3000/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.1.228:3000/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:3000/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/marcellamaki/Documents/learning-equality/kolibri/public' directory
INFO     Kolibri running on: http://192.168.1.228:8000/
INFO     Kolibri running on: http://127.0.0.1:8000/
INFO     Starting on 0.0.0.0:0
INFO     Waiting for 0.0.0.0:52309
INFO     Serving on 0.0.0.0:52309
INFO     Bus state: RUN
INFO     Updating ourselves to zeroconf network with id '2c0341bf62828f224eb0b37bf673fee3' and port '8000'
assets by status 948 KiB [cached] 4 assets
runtime modules 8.93 KiB 14 modules
orphan modules 15.9 KiB [orphan] 10 modules
javascript modules 668 KiB
  modules by path ./ 372 KiB
    modules by path ./node_modules/core-js/ 172 KiB 157 modules
    modules by path ./src/ 197 KiB 19 modules
    modules by path ./node_modules/uuid/dist/esm-browser/*.js 3.24 KiB 5 modules
  modules by path ../../node_modules/ 296 KiB
    modules by path ../../node_modules/lodash/*.js 126 KiB 163 modules
    modules by path ../../node_modules/toposort-class/ 7.96 KiB 2 modules
json modules 1.12 KiB
  ./h5p_build.json 66 bytes [built] [code generated]
  ./src/mimetypes.json 1.05 KiB [built] [code generated]
webpack 5.32.0 compiled successfully in 5136 ms
Kolibri Build: Completed 'kolibri.plugins.device.side_nav' bundle in 7.239s!
Kolibri Build: Completed 'kolibri.core.frontend_head_assets' bundle in 7.33s!
Kolibri Build: Completed 'kolibri.plugins.user_auth.login_side_nav' bundle in 7.324s!
Kolibri Build: Completed 'kolibri.plugins.facility.side_nav' bundle in 7.333s!
Kolibri Build: Completed 'kolibri.plugins.coach.side_nav' bundle in 7.388s!
Kolibri Build: Completed 'kolibri.plugins.demo_server.main' bundle in 7.434s!
Kolibri Build: Completed 'kolibri.plugins.user_profile.user_profile_side_nav' bundle in 7.418s!
Kolibri Build: Completed 'kolibri.plugins.learn.side_nav' bundle in 7.532s!
Kolibri Build: Completed 'kolibri.plugins.facility.app' bundle in 8.723s!
Kolibri Build: Completed 'kolibri.plugins.pdf_viewer.main' bundle in 9.125s!
Kolibri Build: Completed 'kolibri.plugins.user_auth.app' bundle in 9.248s!
Kolibri Build: Completed 'kolibri.plugins.media_player.main' bundle in 9.827s!
Kolibri Build: Completed 'kolibri.plugins.user_profile.app' bundle in 10.723s!
Kolibri Build: Completed 'kolibri.plugins.device.app' bundle in 11.804s!
Kolibri Build: Completed 'kolibri.plugins.setup_wizard.app' bundle in 12.506s!
Kolibri Build: Completed 'kolibri.plugins.epub_viewer.main' bundle in 12.628s!
Kolibri Build: Completed 'kolibri.plugins.slideshow_viewer.main' bundle in 12.813s!
Kolibri Build: Completed 'kolibri.plugins.perseus_viewer.main' bundle in 12.879s!
Kolibri Build: Completed 'kolibri.plugins.html5_viewer.main' bundle in 14.107s!
Kolibri Build: Completed 'kolibri.plugins.learn.app' bundle in 14.455s!
Kolibri Build: Completed 'kolibri.plugins.coach.app' bundle in 14.702s!
Kolibri Build: Completed 'kolibri.core.default_frontend' bundle in 17.041s!
Kolibri Build: Build complete
INFO     127.0.0.1 - - "GET /en/learn/" 200 0 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"
INFO     127.0.0.1 - - "PUT /api/auth/session/current/" 200 0 "http://127.0.0.1:8000/en/learn/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"
INFO     127.0.0.1 - - "GET /learn/api/state" 200 0 "http://127.0.0.1:8000/en/learn/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"

```
</details> 


Discussion:
Updated to add logs for when "This site can't be reached" happens and `Uncaught ReferenceError: kolibriCoreAppGlobal is not defined`. 

The short version is: 
1. Start working on a branch for the day. Builds as expected (logs 1) 
2. Switch to a different working branch off of develop, doesn't build (logs 2) 
3. `kill -9 $(pgrep -f kolibri)` -> `yarn run devserver` -> logs 3
4.  `kill -9 $(pgrep -f kolibri)` -> `yarn run devserver` -> works again! (logs 4)

It does not always happens with just one go-round, but this does seem to be the general pattern, that both _types_ of errors occur at least once and sometimes more than once, and then it just.... resolves. 
Examination of the network tab when this error occurs seems to show that Kolibri is completely failing to pick up that builds are either in process or have completed. Only the quick to compile head assets are attempted to be fetched:
![image](https://user-images.githubusercontent.com/1680573/175337284-87dfc14e-0951-4746-a0d0-4a8cd9d859ea.png)

This makes me suspect that this is not actually an issue with webpack, but rather with Kolibri failing to pick up the changes in the stats files.

Resolving patch:
diff --git a/kolibri/core/webpack/hooks.py b/kolibri/core/webpack/hooks.py
--- a/kolibri/core/webpack/hooks.py
+++ b/kolibri/core/webpack/hooks.py
@@ -101,7 +101,7 @@ def _stats_file_content(self):
         if getattr(settings, "DEVELOPER_MODE", False):
             timeout = 0
 
-            while stats["status"] == "compiling":
+            while stats["status"] == "compile":
                 time.sleep(0.1)
                 timeout += 0.1
 


Test patch: