Closed ni554n closed 1 year ago
Can you share how to reproduce this?
I don't really see how this can be fixed. This package is meant to be empty, it contains 0 bytes of executable code. There is nothing wrong here, so there is nothing that we can do to fix it.
It seems like Astro seems to assume that such packages are invalid. IMO this assumption is incorrect. Perhaps you should open an issue for Astro and tell them that this warning is reported incorrectly. Perhaps there is a way to suppress such warnings.
I will close this now as there is nothing to do here. Please comment if the astro authors disagree and can come up with any ideas that can be improved about this repo.
Thanks for looking into it.
I searched around a bit on GitHub issues and found out it's a Vite thing. The solution is very simple though.
Just adding // module.exports
(as a comment) in the mod.js
file makes the warning go away. 😅
Oh wow. Feel free to open a pull request that adds such a comment to mod.ts
if that helps :)
@KnorpelSenf Hi, I just checked the latest release of this package, and the comments are not present in the mod.js
file.
Aren't they supposed to be there if not explicitly disabled using https://www.typescriptlang.org/tsconfig#removeComments ?
@wojpawlik?
Maybe setting that option explicitly in this project's tsconfig would do the trick!?
That'd change nothing. What about adding export {}
to mod.ts
?
We'd have to experiment with this. Why are JSDoc string kept but //
comments stripped? Or did I misunderstand?
@KnorpelSenf I'm not sure how to experiment with this package. I've never used deno in a local environment. Can you please write a build instruction?
Yes, I should add that to the README, you're right.
Just run npm install
in the top level directory of this repo. That will download all deps and compile the code. Run npm run prepare
to recompile.
It's easier to install Deno tooling. There's a VSCode extension for Deno. Run deno task
to see available tasks, and run deno task backport
to compile. In fact, that's what npm uses under the hood, too.
I found the problem. Please review #26.
Update your deps and it will be fixed
Yes! Just tested it. No more warning! Thanks a lot.
Version: 3.0.3
I'm getting this warning in an Astro project that uses Vite under the hood.
I think the solution might be to add an empty export to the
mod.js
file so that it can be detected as Common JS module in Vite.