[GH-ISSUE #270] TypeError: Cannot read properties of undefined (reading 'IS_FAKE_WEB') #7075

Closed
opened 2026-04-10 16:44:41 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @tekumara on GitHub (Oct 9, 2022).
Original GitHub issue: https://github.com/actualbudget/actual/issues/270

Verified issue does not already exist?

I have searched and found no existing issue

What happened?

$ yarn start

webpack is watching the files…

App threw an error during load
Error: Cannot find module 'loot-core/lib-dist/bundle.desktop.js'
Require stack:
- /Users/tekumara/code3/actual/packages/desktop-electron/window-state.js
- /Users/tekumara/code3/actual/packages/desktop-electron/index.js
- /Users/tekumara/code3/actual/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js
-
    at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:261:1128)
    at Module._load (internal/modules/cjs/loader.js:732:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/tekumara/code3/actual/packages/desktop-electron/window-state.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
ℹ 「wds」: Project is running at http://192.168.68.100/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /Users/tekumara/code3/actual/packages/desktop-client/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...

Hash: 6ec76d136026da4d3e9a
Version: webpack 4.46.0
Time: 4380ms
Built at: 09/10/2022 3:09:12 pm
                Asset      Size  Chunks                   Chunk Names
    bundle.desktop.js   2.2 MiB    main  [emitted]        main
bundle.desktop.js.map  3.35 MiB    main  [emitted] [dev]  main
Entrypoint main = bundle.desktop.js bundle.desktop.js.map
[./packages/api/injected.js] 80 bytes {main} [built]
[./packages/import-ynab4/importer.js] 13.5 KiB {main} [built]
[./packages/import-ynab5/importer.js] 8.53 KiB {main} [built]
[./packages/loot-core/src/mocks/budget.js] 22.8 KiB {main} [built]
[./packages/loot-core/src/platform/exceptions/index.electron.js] 291 bytes {main} [built]
[./packages/loot-core/src/platform/server/asyncStorage/index.electron.js] 1.46 KiB {main} [built]
[./packages/loot-core/src/platform/server/connection/index.electron.js] 2.89 KiB {main} [built]
[./packages/loot-core/src/platform/server/fs/index.electron.js] 4.43 KiB {main} [built]
[./packages/loot-core/src/platform/server/log/index.electron.js] 272 bytes {main} [built]
[./packages/loot-core/src/platform/server/sqlite/index.electron.js] 2.28 KiB {main} [built]
[./packages/loot-core/src/platform/uuid/index.electron.js] 166 bytes {main} [built]
[./packages/loot-core/src/server/accounts/export-to-csv.js] 2.32 KiB {main} [built]
[./packages/loot-core/src/server/accounts/link.js] 4.3 KiB {main} [built]
[./packages/loot-core/src/server/accounts/parse-file.js] 2.68 KiB {main} [built]
[./packages/loot-core/src/server/main.js] 63.3 KiB {main} [built]
    + 385 hidden modules
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Compiled successfully!

You can now view @actual-app/web in the browser.

  Local:            http://localhost:3001/
  On Your Network:  http://192.168.68.100:3001/

Note that the development build is not optimized.
To create a production build, use npm run build.

What error did you receive?

When opening the browser to http://localhost:3001/

TypeError: Cannot read properties of undefined (reading 'IS_FAKE_WEB')
Module.<anonymous>
src/client/platform.js:14
  11 | export default {
  12 |   OS: isWindows ? 'windows' : isMac ? 'mac' : 'linux',
  13 |   env: 'web',
> 14 |   isBrowser: !!window.Actual.IS_FAKE_WEB,
  15 |   isReactNativeWeb: false,
  16 |   isProbablySafari
  17 | };
View compiled
../loot-core/src/client/platform.js
http://localhost:3001/static/js/main.chunk.js:3626:30

Where are you hosting Actual?

Locally via Yarn

What browsers are you seeing the problem on?

Chrome

Operating System

Mac OSX

Originally created by @tekumara on GitHub (Oct 9, 2022). Original GitHub issue: https://github.com/actualbudget/actual/issues/270 ### Verified issue does not already exist? I have searched and found no existing issue ### What happened? ``` $ yarn start webpack is watching the files… App threw an error during load Error: Cannot find module 'loot-core/lib-dist/bundle.desktop.js' Require stack: - /Users/tekumara/code3/actual/packages/desktop-electron/window-state.js - /Users/tekumara/code3/actual/packages/desktop-electron/index.js - /Users/tekumara/code3/actual/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js - at Module._resolveFilename (internal/modules/cjs/loader.js:887:15) at Function.n._resolveFilename (electron/js2c/browser_init.js:261:1128) at Module._load (internal/modules/cjs/loader.js:732:27) at Function.f._load (electron/js2c/asar_bundle.js:5:12913) at Module.require (internal/modules/cjs/loader.js:959:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (/Users/tekumara/code3/actual/packages/desktop-electron/window-state.js:4:15) at Module._compile (internal/modules/cjs/loader.js:1078:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10) at Module.load (internal/modules/cjs/loader.js:935:32) ℹ 「wds」: Project is running at http://192.168.68.100/ ℹ 「wds」: webpack output is served from / ℹ 「wds」: Content not from webpack is served from /Users/tekumara/code3/actual/packages/desktop-client/public ℹ 「wds」: 404s will fallback to / Starting the development server... Hash: 6ec76d136026da4d3e9a Version: webpack 4.46.0 Time: 4380ms Built at: 09/10/2022 3:09:12 pm Asset Size Chunks Chunk Names bundle.desktop.js 2.2 MiB main [emitted] main bundle.desktop.js.map 3.35 MiB main [emitted] [dev] main Entrypoint main = bundle.desktop.js bundle.desktop.js.map [./packages/api/injected.js] 80 bytes {main} [built] [./packages/import-ynab4/importer.js] 13.5 KiB {main} [built] [./packages/import-ynab5/importer.js] 8.53 KiB {main} [built] [./packages/loot-core/src/mocks/budget.js] 22.8 KiB {main} [built] [./packages/loot-core/src/platform/exceptions/index.electron.js] 291 bytes {main} [built] [./packages/loot-core/src/platform/server/asyncStorage/index.electron.js] 1.46 KiB {main} [built] [./packages/loot-core/src/platform/server/connection/index.electron.js] 2.89 KiB {main} [built] [./packages/loot-core/src/platform/server/fs/index.electron.js] 4.43 KiB {main} [built] [./packages/loot-core/src/platform/server/log/index.electron.js] 272 bytes {main} [built] [./packages/loot-core/src/platform/server/sqlite/index.electron.js] 2.28 KiB {main} [built] [./packages/loot-core/src/platform/uuid/index.electron.js] 166 bytes {main} [built] [./packages/loot-core/src/server/accounts/export-to-csv.js] 2.32 KiB {main} [built] [./packages/loot-core/src/server/accounts/link.js] 4.3 KiB {main} [built] [./packages/loot-core/src/server/accounts/parse-file.js] 2.68 KiB {main} [built] [./packages/loot-core/src/server/main.js] 63.3 KiB {main} [built] + 385 hidden modules Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating Compiled successfully! You can now view @actual-app/web in the browser. Local: http://localhost:3001/ On Your Network: http://192.168.68.100:3001/ Note that the development build is not optimized. To create a production build, use npm run build. ``` ### What error did you receive? When opening the browser to http://localhost:3001/ ``` TypeError: Cannot read properties of undefined (reading 'IS_FAKE_WEB') Module.<anonymous> src/client/platform.js:14 11 | export default { 12 | OS: isWindows ? 'windows' : isMac ? 'mac' : 'linux', 13 | env: 'web', > 14 | isBrowser: !!window.Actual.IS_FAKE_WEB, 15 | isReactNativeWeb: false, 16 | isProbablySafari 17 | }; View compiled ../loot-core/src/client/platform.js http://localhost:3001/static/js/main.chunk.js:3626:30 ``` ### Where are you hosting Actual? Locally via Yarn ### What browsers are you seeing the problem on? Chrome ### Operating System Mac OSX
GiteaMirror added the bug label 2026-04-10 16:44:41 -05:00
Author
Owner

@trevdor commented on GitHub (Oct 10, 2022):

🤔 Hmm, I've run into that before, but just ignored it because what I really wanted is given by yarn start:browser.
We should probably figure out what's up with this error, but try that to get things running for now.

<!-- gh-comment-id:1272708958 --> @trevdor commented on GitHub (Oct 10, 2022): 🤔 Hmm, I've run into that before, but just ignored it because what I really wanted is given by `yarn start:browser`. We should probably figure out what's up with this error, but try that to get things running for now.
Author
Owner

@trevdor commented on GitHub (Oct 10, 2022):

Ok, so yarn start is an alias for starting all the desktop-* jobs, which are collectively meant for firing up the Electron version of the app. If all goes to plan, you'll see a window or two open (actual-server and actual) running the app. Although it takes a sec, at least on my machine.

The browser jobs are best for running in the...erm, browser. :D And IS_FAKE_WEB will be set there.

It could be a good fixup for us to direct folks to Electron when loading this version in the browser.

<!-- gh-comment-id:1273776344 --> @trevdor commented on GitHub (Oct 10, 2022): Ok, so `yarn start` is an alias for starting all the `desktop-*` jobs, which are collectively meant for firing up the Electron version of the app. If all goes to plan, you'll see a window or two open (actual-server and actual) running the app. Although it takes a sec, at least on my machine. The `browser` jobs are best for running in the...erm, browser. :D And IS_FAKE_WEB will be set there. It could be a good fixup for us to direct folks to Electron when loading this version in the browser.
Author
Owner

@MatissJanis commented on GitHub (Jan 21, 2023):

👋 I believe this has been fixed. Could you please verify @tekumara ?

<!-- gh-comment-id:1399237857 --> @MatissJanis commented on GitHub (Jan 21, 2023): 👋 I believe this has been fixed. Could you please verify @tekumara ?
Author
Owner

@tekumara commented on GitHub (Mar 14, 2023):

This is now fixed, thank you!

<!-- gh-comment-id:1467333131 --> @tekumara commented on GitHub (Mar 14, 2023): This is now fixed, thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#7075