Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build on Linux with Webpack #58

Open
michaelpanik opened this issue May 6, 2024 · 1 comment
Open

Unable to build on Linux with Webpack #58

michaelpanik opened this issue May 6, 2024 · 1 comment

Comments

@michaelpanik
Copy link

Attempting to webpack a project that uses this package. I get the win-dpapi error, and a lot of other confusing errors. When I attempt to just install win-dpapi, it tells me it can't because I'm on Linux.

ERROR in ./node_modules/chrome-cookies-secure/index.js 72:10-30
Module not found: Error: Can't resolve 'win-dpapi' in 'REDACTED/node_modules/chrome-cookies-secure'
resolve 'win-dpapi' in 'REDACTED/node_modules/chrome-cookies-secure'
  Parsed request is a module
  using description file: REDACTED/node_modules/chrome-cookies-secure/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      REDACTED/node_modules/chrome-cookies-secure/node_modules doesn't exist or is not a directory
      REDACTED/node_modules/node_modules doesn't exist or is not a directory
      looking for modules in REDACTED/node_modules
        single file module
          using description file: REDACTED/package.json (relative path: ./node_modules/win-dpapi)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              REDACTED/node_modules/win-dpapi doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              REDACTED/node_modules/win-dpapi.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              REDACTED/node_modules/win-dpapi.js doesn't exist
        REDACTED/node_modules/win-dpapi doesn't exist
      /home/mpanik/localhost/node_modules doesn't exist or is not a directory
      /home/mpanik/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
 @ ./src/popup.js 3:22-54
@rubengmurray
Copy link
Collaborator

Yes I presume webpack is attempting to bundle win-dpapi despite it only being required at runtime inside an if block check for Windows OS:

} else if (process.platform === 'win32') {

Technically on linux it will never be used/required.

Wonder if there is a webpack setting to prevent that happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants