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

Issue: Warnings and Missing .local-chromium in Puppeteer Setup #29

Open
1 task
ianbuchanan42 opened this issue Jan 3, 2025 · 0 comments
Open
1 task
Labels
bug Something isn't working

Comments

@ianbuchanan42
Copy link
Collaborator

Description

Critical Dependency Warnings:
During the build process, several warnings related to critical dependencies were observed:

File: ./node_modules/cosmiconfig/dist/loaders.js
File: ./node_modules/import-fresh/index.js
File: ./node_modules/typescript/lib/typescript.js
These warnings are linked to dynamic imports in the Puppeteer and related dependencies, potentially affecting build reliability.

Missing .local-chromium:
Puppeteer does not create the .local-chromium directory in node_modules due to updated behavior:

Shared Cache Directory: Chromium binaries are now stored in ~/.cache/puppeteer by default to reduce redundancy across projects.
Possible Causes:
Use of puppeteer-core instead of puppeteer.
Environment variables (PUPPETEER_SKIP_DOWNLOAD, PUPPETEER_CACHE_DIR) modifying download behavior.
Installation issues due to network or configuration errors.
Resolution Steps:
Addressing Critical Dependency Warnings:

Enable detailed error logs (--stats-error-details) for more insights.
Investigate and refactor any dynamic imports where feasible.
Restoring .local-chromium:

Set the PUPPETEER_CACHE_DIR to node_modules/puppeteer/.local-chromium.
Redownload Chromium using:
bash
Copy code
node node_modules/puppeteer/install.mjs
Packaging Chromium for Extensions:

Use tools like vsce to include .local-chromium in the package.
Address size limitations for the VS Code Marketplace (200 MB) using:
Platform-specific builds.
Dynamic Chromium downloads.
Debugging Chromium Path Issues:

Confirm Chromium’s executable path using Puppeteer’s API:
javascript
Copy code
const puppeteer = require('puppeteer');
console.log(puppeteer.executablePath());
Recommendations:
Use puppeteer (not puppeteer-core) for bundled Chromium unless a custom solution is needed.
Fine-tune .vscodeignore to manage package size efficiently.
For VS Code extensions, verify Chromium inclusion and test on clean environments.

Reproduction

Have only built our Mac supported bundle with chromium includes. Assuming similar issues will be encountered building chromium bundled version for Windows and Linux.

System information

npm run build
vsce package

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd love to make a PR to fix this bug!
@ianbuchanan42 ianbuchanan42 added the bug Something isn't working label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant