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

Uncaught ReferenceError: __dirname is not defined #73

Open
vdegenne opened this issue Mar 24, 2023 · 1 comment
Open

Uncaught ReferenceError: __dirname is not defined #73

vdegenne opened this issue Mar 24, 2023 · 1 comment

Comments

@vdegenne
Copy link

I am using this package in a ES Module context.
When I load my project in the browser I get the follow error:

Uncaught ReferenceError: __dirname is not defined

The message is pretty obvious. First __dirname doesn't exist in es module context. Second, I think it would be better to make your package es-module compliant. Removing require replacing with import statements and trying to remove the use of path library which is not loadable in browsers.

@lawik
Copy link

lawik commented Sep 26, 2023

Just fought this. Here is a PR with my suggested fix: #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants