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

🚀 Feature Request: Support __dirname #7606

Open
noClaps opened this issue Dec 22, 2024 · 0 comments
Open

🚀 Feature Request: Support __dirname #7606

noClaps opened this issue Dec 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@noClaps
Copy link

noClaps commented Dec 22, 2024

Describe the solution

I'm pretty sure this is a bug, but I didn't see a bug report issue so I opened a feature request instead.

I'm getting this error:

Uncaught ReferenceError: __dirname is not defined

Minimal reproduction:

// index.ts
import { Hono } from "hono";

const app = new Hono();

console.log(__dirname);

export default app 

and my wrangler.toml:

main = "index.ts"
compatibility_date = "2024-12-22"
compatibility_flags = ["nodejs_compat"]

Expected behavior

__dirname should output the directory that the file is currently in, similar to import.meta.dir.

@noClaps noClaps added the enhancement New feature or request label Dec 22, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Untriaged
Development

No branches or pull requests

1 participant