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

[Bug]: i use puppeteer-core in Chrome extension ,but is has some question: "urlToHttpOptions" is not exported by "__vite-browser-external", imported by "node_modules/@puppeteer/browsers/lib/esm/httpUtil.js". #11809

Closed
2 tasks
guobcKf opened this issue Feb 2, 2024 · 5 comments

Comments

@guobcKf
Copy link

guobcKf commented Feb 2, 2024

Minimal, reproducible example

import { onMessage } from "webext-bridge/devtools";
import puppeteer from 'puppeteer-core';
onMessage('init-pop',async () => {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto(chrome.runtime.getURL('popup/index.html'));
})

Error string

"urlToHttpOptions" is not exported by "__vite-browser-external", imported by "node_modules/@puppeteer/browsers/lib/esm/httpUtil.js".

Bug behavior

  • Flaky
  • PDF

Background

No response

Expectation

可以解决此问题

Reality

build is error

Puppeteer configuration file (if used)

{
  "name": "vue-chrome-ext",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vue-tsc && vite build",
    "preview": "vite preview",
    "watch-build": "vite --watch build",
    "watch-json": "node watch.mjs"
  },
  "dependencies": {
    "naive-ui": "^2.37.3",
    "pinia": "^2.1.7",
    "puppeteer-core": "^21.10.0",
    "puppeteer-extension-transport": "^0.0.6",
    "vue": "^3.3.11",
    "webext-bridge": "^6.0.1"
  },
  "devDependencies": {
    "@types/node": "^20.11.6",
    "@vitejs/plugin-vue": "^4.5.2",
    "chrome-types": "^0.1.253",
    "less": "^4.2.0",
    "rollup-plugin-copy": "^3.5.0",
    "typescript": "^5.2.2",
    "vite": "^5.0.8",
    "vue-tsc": "^1.8.25"
  }
}

Puppeteer version

^21.10.0

Node version

v16.20.2

Package manager

npm

Package manager version

vite ^5.0.8

Operating system

Windows

@guobcKf guobcKf added the bug label Feb 2, 2024
Copy link

github-actions bot commented Feb 2, 2024

This issue has an invalid Puppeteer version: ^21.10.0. Versions must follow SemVer formatting. Please update the form with a valid version.


Analyzer run

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 2, 2024

Could you clarify what the Puppeteer issue is? It looks like a problem caused by vite?

@guobcKf
Copy link
Author

guobcKf commented Mar 14, 2024

Could you clarify what the Puppeteer issue is? It looks like a problem caused by vite?

yes,i have use puppeteer-extension-transport and puppeteer-core@^13.7.0 in chrome extensions,but i think it is to old,if i can use most new?

@guobcKf
Copy link
Author

guobcKf commented Mar 20, 2024

Could you clarify what the Puppeteer issue is? It looks like a problem caused by vite?

hello,I have some question.When I simulate a click to open a new page. After connecting to it, the page method obtained will not respond and it will stay stuck there.

@OrKoN
Copy link
Collaborator

OrKoN commented Mar 20, 2024

I think puppeteer-extension-transport is not compatible with the latest Puppeteer versions. See discussion with #12022 If you encounter a bug, please file a new issue with a minimal reproducible example but note that we are not able to support old versions for that use case.

@OrKoN OrKoN closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants