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

ReferenceError: Cannot access uninitialized variable when using Puppeteer #2316

Closed
swissspidy opened this issue Mar 6, 2023 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@swissspidy
Copy link

What version of Bun is running?

0.5.7

What platform is your computer?

Darwin 22.3.0 arm64 arm

What steps can reproduce the bug?

// script.ts
import puppeteer from "puppeteer";

const browser = await puppeteer.launch();

package.json has "type": "module" and references puppeteer ^19.6.3.

What is the expected behavior?

No error and Puppeteer should run.

What do you see instead?

$ bun script.ts 
28 | import { ElementHandle, } from '../api/ElementHandle.js';
29 | import { assert } from '../util/assert.js';
30 | import { AsyncIterableUtil } from '../util/AsyncIterableUtil.js';
31 | import { getQueryHandlerAndSelector } from './GetQueryHandler.js';
32 | import { CDPJSHandle } from './JSHandle.js';
33 | import { debugError, isString } from './util.js';
   ^
ReferenceError: Cannot access uninitialized variable.
      at /path/to/../node_modules/puppeteer-core/lib/esm/puppeteer/common/ElementHandle.js:33:0

Additional information

No response

@swissspidy swissspidy added the bug Something isn't working label Mar 6, 2023
@uqe
Copy link

uqe commented Mar 15, 2023

Same issue.

Bun: v0.5.7
Puppeteer: v19.7.5

@way-zer
Copy link

way-zer commented Mar 16, 2023

Relevant issue(esm circular dependency)
Bun: v0.5.7
@deepkit/type: 1.0.1-alpha.91

import {as} from "@deepkit/type"
as()

Output:

1 | /*@ts-ignore*/
2 | import { __ΩTypeParameter as __ΩTypeParameter } from './type.js';
   ^
ReferenceError: Cannot access uninitialized variable.
      at node_modules/@deepkit/type/dist/esm/src/reflection/extends.js:2:0

@wavded
Copy link

wavded commented May 19, 2023

I think I have the same issue:

Bun: 0.6.2
Puppeteer: 20.2.1

25 |     return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
26 | };
27 | var _CDPJSHandle_disposed, _CDPJSHandle_context, _CDPJSHandle_remoteObject;
28 | import { JSHandle } from '../api/JSHandle.js';
29 | import { assert } from '../util/assert.js';
30 | import { createJSHandle, releaseObject, valueFromRemoteObject, withSourcePuppeteerURLIfNone, } from './util.js';
   ^
ReferenceError: Cannot access uninitialized variable.
      at /path/to.../node_modules/puppeteer/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js:30:0
      at /path/to.../node_modules/puppeteer/node_modules/puppeteer-core/lib/esm/puppeteer/common/ElementHandle.js:33:0
      at /path/to.../node_modules/puppeteer/node_modules/puppeteer-core/lib/esm/puppeteer/common/util.js:32:0
      at /path/to.../node_modules/puppeteer/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:24:0

@dylan-conway
Copy link
Collaborator

Puppeteer is working in 0.6.6

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

5 participants