Open dillionverma opened 6 days ago
I added a commit which triggers this issue here
https://github.com/magicuidesign/magicui/pull/189/commits/0b127bb9b06c1f62abe1fce5086c186a39444fda
Based on your description, it seems that this has nothing to do with Velite.
Anyway, I will try to reproduce the problem you mentioned first.
I think I know what the problem is.
I need some time to see if there is a better solution.
a similar issue also occurred with another component in the registry which I completely removed called "wavy-dot-pattern" and these issues didn't occur with contentlayer which led me to believe it was something to do with the way velite is bundling / rendering the markdown
Yes, the reason is that I stopped bundling third-party libraries in the velite.config.ts in a previous version, which is different from contentlayer
https://github.com/zce/velite/pull/62
Please wait for me for a moment
A brief explanation of the cause of the problem: In the reference files of velite.config.ts
, some modules not intended for the Node.js runtime were imported using dynamic import, and these imports are unrelated to the operation of Velite.
However, the esbuild used internally by Velite tries to bundle and execute these modules, which are not for the Node.js runtime, leading to the issue.
Although Velite can ignore the bundling of these modules by specifying esbuild's external
configuration option, like this: external: ["@/registry"]
, I believe this is not a common scenario, so I don't plan to support custom external
. For detailed reasons, refer to #62.
I personally think there are two solutions to this problem:
Since the original codebase seems to be missing some files, the PR is not yet complete. If you agree with my view, I can try to improve it when I have time.
thanks for prompt responses!
i took a quick look at the PR and think it should theoretically work
I also prefer option 1 instead of having to maintain the two separate files
tried to test locally but noticed specific pages weren't running
im not too familiar with the lower level details lazy components yet - any idea what might be going on here?
Trying to migrate from contentlayer to velite
PR is here https://github.com/magicuidesign/magicui/pull/189
Ran existing code base through velite but get this error
react-tweet
is a dependency included in a code snippet which gets rendered as a component using mdx