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

Doesn't work in esm project #4

Open
altano opened this issue Aug 7, 2023 · 0 comments
Open

Doesn't work in esm project #4

altano opened this issue Aug 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@altano
Copy link

altano commented Aug 7, 2023

I have a type: module project and it looks like that's tripping this library up. In canvaskit-wasm (a dep of the project) __dirname is used which results in this error:

▶ src/pages/articles/index.astro
  └─ /articles/index.html (+6ms)
 error   __dirname is not defined in ES module scope
  File:
    /Users/alan/src/alan.norbauer.com-astro-v2/dist/chunks/pages/open-graph.ts.6ecf069b.mjs:35419:43
  Code:
    35418 |   arguments.length;};})();})(w);var sa=Object.assign({},w),va="./this.program",wa=(a,b)=>{throw b;},xa="object"==typeof window,ya="function"==typeof importScripts,za="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,Ba="",Ca,Da,Ea,fs,Fa,Ga;
    > 35419 |   if(za)Ba=ya?require$$0$1.dirname(Ba)+"/":__dirname+"/",Ga=()=>{Fa||(fs=require$$1,Fa=require$$0$1);},Ca=function(a,b){Ga();a=Fa.normalize(a);return fs.readFileSync(a,b?void 0:"utf8")},Ea=a=>{a=Ca(a,!0);a.buffer||(a=new Uint8Array(a));return a},Da=(a,b,d)=>{Ga();a=Fa.normalize(a);fs.readFile(a,function(f,h){f?d(f):b(h.buffer);});},1<process.argv.length&&(va=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("unhandledRejection",function(a){throw a;}),wa=(a,b)=>{if(noExitRuntime)throw process.exitCode=
            |                                           ^
@rhiskey rhiskey self-assigned this Aug 10, 2023
@rhiskey rhiskey added the bug Something isn't working label Aug 10, 2023
@rhiskey rhiskey removed their assignment Aug 19, 2023
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