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]: ESM build contains __dirname references again #2845

Closed
1 task done
KubaJastrz opened this issue Oct 20, 2024 · 1 comment
Closed
1 task done

[Bug]: ESM build contains __dirname references again #2845

KubaJastrz opened this issue Oct 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@KubaJastrz
Copy link

KubaJastrz commented Oct 20, 2024

Version

v5.20.0

Platform

NodeJS

What happened?

__dirname was added in this PR: #2822

Related issue from the past: #2288

Downgrading to 5.19.1 works for me

How to reproduce.

I'm using bullmq with Remix+Vite setup which enforces use of ESM in production. Let me know if you need actual reproduction or the problem description is enough.

Relevant log output

ReferenceError: __dirname is not defined
    at readPackageJson (file:///<redacted>/node_modules/.pnpm/[email protected]/node_modules/bullmq/dist/esm/utils.js:192:14)
    at RedisConnection.init (file:///<redacted>/node_modules/.pnpm/[email protected]/node_modules/bullmq/dist/esm/classes/redis-connection.js:151:29)
    at new RedisConnection (file:///<redacted>/node_modules/.pnpm/[email protected]/node_modules/bullmq/dist/esm/classes/redis-connection.js:59:34)
    at new QueueBase (file:///<redacted>/node_modules/.pnpm/[email protected]/node_modules/bullmq/dist/esm/classes/queue-base.js:35:27)
    at new Queue2 (file:///<redacted>/node_modules/.pnpm/[email protected]/node_modules/bullmq/dist/esm/classes/queue.js:17:9)
    at file:///<redacted>/packages/queue/src/<redacted>:9:37
    at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
    at ModuleLoader.import (node:internal/modules/esm/loader:475:24)
    at run (/<redacted>/node_modules/.pnpm/@[email protected][email protected]/node_modules/@remix-run/serve/dist/cli.js:112:15)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@KubaJastrz KubaJastrz added the bug Something isn't working label Oct 20, 2024
@manast
Copy link
Contributor

manast commented Nov 8, 2024

From version 5.21.2 https://github.com/taskforcesh/bullmq/blob/master/docs/gitbook/changelog.md#5212-2024-10-22
it should be resolved as we now generate the version in release time and do not need to read the package.json anymore which is actually impossible to do in NodeJS in a reliable way.

@manast manast closed this as completed Nov 8, 2024
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

2 participants