AlexTorresDev / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
870 stars 149 forks source link

Multiple warnings in console: "Failed to parse source map from '[.../browser.ts and others]' file: Error: ENOENT" #135

Closed john8329 closed 2 years ago

john8329 commented 3 years ago

Describe the bug Since the first time I installed the library, the errors popped on the console.

WARNING in ./node_modules/custom-electron-titlebar/lib/menu/menu.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/.../node_modules/custom-electron-titlebar/src/menu/menu.ts' file: Error: ENOENT: no such file or directory, open '/.../node_modules/custom-electron-titlebar/src/menu/menu.ts'

WARNING in ./node_modules/custom-electron-titlebar/lib/menu/menuitem.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/.../node_modules/custom-electron-titlebar/src/menu/menuitem.ts' file: Error: ENOENT: no such file or directory, open '/.../node_modules/custom-electron-titlebar/src/menu/menuitem.ts'

WARNING in ./node_modules/custom-electron-titlebar/lib/menubar.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/.../node_modules/custom-electron-titlebar/src/menubar.ts' file: Error: ENOENT: no such file or directory, open '/.../node_modules/custom-electron-titlebar/src/menubar.ts'

WARNING in ./node_modules/custom-electron-titlebar/lib/themebar.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/.../node_modules/custom-electron-titlebar/src/themebar.ts' file: Error: ENOENT: no such file or directory, open '/.../node_modules/custom-electron-titlebar/src/themebar.ts'

WARNING in ./node_modules/custom-electron-titlebar/lib/titlebar.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/.../node_modules/custom-electron-titlebar/src/titlebar.ts' file: Error: ENOENT: no such file or directory, open '/.../node_modules/custom-electron-titlebar/src/titlebar.ts'

I narrowed the issue to the source maps, which point to non-existing files in node_modules/custom-electron-titlebar/src/[file].ts. Other packages don't do such things, rather they point to .d.ts definitions.

Fixing it requires the source maps to be changed from this:

{"version":3,"file":"themebar.js","sourceRoot":"","sources":["../src/themebar.ts"],

To this (since sources aren't included):

{"version":3,"file":"themebar.js","sourceRoot":"","sources":["./themebar.d.ts"],

To Reproduce Steps to reproduce the behavior:

  1. Install the library on an Angular 10 app
  2. Open Dev tools
  3. See error

Expected behavior It shouldn't

Screenshots Screenshot 2021-02-14 at 11 50 05

Desktop (please complete the following information):

EdvinM commented 3 years ago

I can confirm this issue. Started to happen since latest update.

IvanGodinez21 commented 3 years ago

I have the same issue

JosueIglesias commented 3 years ago

me too!

stale[bot] commented 2 years ago

📢 This issue has been closed automatically because it has not had recent activity. Thank you for your contributions.