Skip to content

Conversation

@euvinkeel
Copy link
Contributor

@euvinkeel euvinkeel commented Jan 14, 2026

instead of the initial fix of:

import { fileURLToPath } from "node:url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

i opted to go with just doing an inline version to mirror nevermore.ts:

export function getTemplatePathByName(name: string) {
  return path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'templates', name);
}

Fixes #639

@Quenty Quenty changed the title use import.meta.url to define __dirname fix: use import.meta.url to define __dirname Jan 14, 2026
@Quenty Quenty merged commit c2a4036 into Quenty:main Jan 14, 2026
4 of 5 checks passed
@Quenty
Copy link
Owner

Quenty commented Jan 14, 2026

omg, thank you! I need to add some integration tests for this.

@Quenty
Copy link
Owner

Quenty commented Jan 14, 2026

🚀 PR was released in @quenty/nevermore-cli@4.13.2 🚀

@Quenty Quenty added the released This issue/pull request has been released. label Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nevermore init ReferenceError: __dirname is not defined

2 participants