__dirname is undefined

Open
#136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
electron, typescript, vite
Domain
desktop

Research direction

Start by reproducing the error in the reported Electron 17.2.0 app using Quasar CLI with Vite. Trace the renderer import path through node_modules/electron/index.js and @electron/remote/dist/src/renderer/remote.js; done means establishing a supported configuration or documenting the incompatibility and its resolution.

Written by the indexing model from the issue text.

Description

Hi, I'm trying to use @electron/remote in an electron 17.2.0 app, and I'm getting this error.

Uncaught (in promise) ReferenceError: __dirname is not defined
    at node_modules/electron/index.js (index.js:4:28)
    at __require (chunk-PWNRNYY6.js?v=91a6c1a2:23:50)
    at node_modules/@electron/remote/dist/src/common/type-utils.js (type-utils.js:4:20)
    at __require (chunk-PWNRNYY6.js?v=91a6c1a2:23:50)
    at node_modules/@electron/remote/dist/src/renderer/remote.js (remote.js:5:22)
    at __require (chunk-PWNRNYY6.js?v=91a6c1a2:23:50)
    at node_modules/@electron/remote/dist/src/renderer/index.js (index.js:15:14)
    at __require (chunk-PWNRNYY6.js?v=91a6c1a2:23:50)
    at node_modules/@electron/remote/renderer/index.js (index.js:1:18)
    at __require (chunk-PWNRNYY6.js?v=91a6c1a2:23:50)

Anyone know how to solve this? It's using Quasar CLI with Vite (https://quasar.dev)

Dominant language
TypeScript
Stars
411
Forks
53
Avg merge
3m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from electron/remote

All issues in electron/remote

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.