question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid warning on Windows: reported dependencies need to be absolute paths.

See original GitHub issue

Bug report

What is the current behavior? When importing “electron” on windows, the following warning is displayed:

Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.

However, the paths listed are already absolute.

This appears to be the same issue resolved here: https://githubmemory.com/repo/sysgears/mochapack/issues/99

If the current behavior is a bug, please provide the steps to reproduce.

For a minimal repro, copy the ABSOLUTE_PATH_REGEX: https://github.com/webpack/webpack/blob/d77d8636015ae71195b16b39dd0e6daebdcace83/lib/NormalModule.js#L87 into regex101 and test the following absolute path: C:/src/TheCoin/apps/admin/node_modules/electron/dist/chrome_100_percent.pak. The regex will fail to match

I have traced the issue to the line import { ipcRenderer } from 'electron';

What is the expected behavior?

No errors. The paths are absolute and things are (to the best of my knowledge) working correctly

I didn’t look any further because the regex kinda doesn’t make sense the way it’s setup. The () brackets don’t separate the characters, so the | or statements don’t switch on the path separator. I’m not actually sure what’s it is testing, but it clearly seems to want to test ^[a-zA-Z]:(\\|\\\\|\/) (note the different opening (

If there are valid reasons to leave the regex as-is, then I’ll try and figure out why this issue is happening the way it is. There may be alternative ways to resolve this.

Other relevant information: webpack version: 5.39.0. I can’t test latest (I’m locked to electron-forge’s version) but the regex has not changed, so I assume the issue still exists. Node.js version: 14 Operating System: Win10 Additional tools: Electron

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-akaitcommented, Aug 9, 2021

It is limitation, otherwise it is not possible to distinguish which path is absolute and which is not, please fix it in a plugin/loader

0reactions
Edge00commented, Feb 23, 2022

Came across to this problem on windows too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid dependencies have been reported by plugins ... - GitHub
Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths #2029.
Read more >
Invalid dependencies have been reported by plugins or ...
All reported dependencies need to be absolute paths. Invalid dependencies may lead to broken watching and caching.
Read more >
use 'stats.errordetails: true' resp. '--stats-error-details' to ... - You.com
Zettlr/ZettlrInvalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths#2029.
Read more >
Module Resolution - webpack
A resolver is a library which helps in locating a module by its absolute path. A module can be required as a dependency...
Read more >
AL Diagnostics - Business Central | Microsoft Learn
Id Message Default Severity AL0100 Unterminated multiline comment. Error AL0104 Syntax error, '' expected. Error AL0106 Syntax error, 'TO' or 'DOWNTO' expected. Error
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found