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

cac not working with Deno 1.0.0 #75

Closed
1 task done
BentoumiTech opened this issue May 13, 2020 · 5 comments
Closed
1 task done

cac not working with Deno 1.0.0 #75

BentoumiTech opened this issue May 13, 2020 · 5 comments
Labels

Comments

@BentoumiTech
Copy link

Issue Type

Deno recently removed the usage of window.location.pathname which now break the fix that was implemented in #70

  • Bug Report

Expected

cac working with Deno

Actual

Rising an exception

Possible Solutions

Replace deno && typeof window !== 'undefined' && window.location.pathname with import.meta.url

Info

  • CAC version: 6.5.8
@egoist egoist closed this as completed in 976c21f May 14, 2020
@egoist
Copy link
Collaborator

egoist commented May 14, 2020

🎉 This issue has been resolved in version 6.5.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

@egoist
Copy link
Collaborator

egoist commented May 14, 2020

I completely removed that for Deno since import.meta.url or the old location.pathname  is the filename of cac/mod.js rather than your program. Now just do cac('my-program') instead. I also fixed the types for Deno: https://github.com/cacjs/cac#with-deno

@BentoumiTech
Copy link
Author

@egoist Thank you for the quick fix.

I've updated my code to work with your last upgrade and included the types but vscode with the deno extension is still complaining here: https://github.com/BentoumiTech/denox/blob/612a2e43f7f16ba53b08cd1c6cfedc8ebe7a6d89/denox.ts#L19

Do you have any idea on why this is reporting an error ?

Repo link: https://github.com/BentoumiTech/denox

@egoist
Copy link
Collaborator

egoist commented May 14, 2020

Ah sorry I just realized this feature is not supported by the vscode plugin yet. denoland/vscode_deno#21

@BentoumiTech
Copy link
Author

@egoist No worries, thanks for your help :)

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

No branches or pull requests

2 participants