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

Error: require() of ES Module not supported #388

Open
fax1ty opened this issue Apr 3, 2024 · 0 comments
Open

Error: require() of ES Module not supported #388

fax1ty opened this issue Apr 3, 2024 · 0 comments
Labels
defect Something isn't working at all or correctly

Comments

@fax1ty
Copy link

fax1ty commented Apr 3, 2024

Describe the bug

Error: require() of ES Module C:\Users\fax1t\AppData\Roaming\Vortex\plugins\Vortex Extension Update - Cyberpunk 2077 Vortex Support v0.10.3\index.js from C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\vortex-run\lib\index.js not supported.
C:\Users\fax1t\AppData\Roaming\Vortex\plugins\Vortex Extension Update - Cyberpunk 2077 Vortex Support v0.10.3\index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename C:\Users\fax1t\AppData\Roaming\Vortex\plugins\Vortex Extension Update - Cyberpunk 2077 Vortex Support v0.10.3\index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in C:\Users\fax1t\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

    at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
    at new NodeError (node:internal/errors:399:5)
    at Module._extensions..js (node:internal/modules/cjs/loader:1297:19)
    at Module.load (node:internal/modules/cjs/loader:1124:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at o._load (node:electron/js2c/renderer_init:2:3109)
    at Function._load (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\renderer.js:9867:126)
    at Module.require (node:internal/modules/cjs/loader:1148:19)
    at Module.require (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\renderer.js:9428:127)
    at Proxy.require (node:internal/modules/cjs/helpers:110:18)
    at installExtensionDependencies (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\renderer.js:2641:16)
    at C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\renderer.js:2643:140
    at tryCatcher (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\async.js:102:5)
    at Async.drainQueues (C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar\node_modules\bluebird\js\release\async.js:15:14)

To Reproduce
Steps to reproduce the behavior:

  1. Try to install CP2077 Support via Vortex

Environment (please complete the following information):

  • OS: Windows 10
  • Extension Version: 0.10.3
@fax1ty fax1ty added the defect Something isn't working at all or correctly label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working at all or correctly
Projects
None yet
Development

No branches or pull requests

1 participant