Comments (9)
I added a commit which triggers this issue here
from velite.
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.
from velite.
I think I know what the problem is.
I need some time to see if there is a better solution.
from velite.
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
from velite.
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
Please wait for me for a moment
from velite.
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:
- Remove the dynamic import from the relevant files: magicuidesign/magicui#190
- Prepare a separate configuration module for the rehype plugin, but this requires keeping the files in sync, so it's not recommended.
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.
from velite.
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
![image](https://private-user-images.githubusercontent.com/16860528/344799428-90515ed7-2816-4ea9-8d23-315c6982b49d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMDI0NjEsIm5iZiI6MTcyNDEwMjE2MSwicGF0aCI6Ii8xNjg2MDUyOC8zNDQ3OTk0MjgtOTA1MTVlZDctMjgxNi00ZWE5LThkMjMtMzE1YzY5ODJiNDlkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1Dc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VhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.IQS3DbPwzw-ox9B4PaScMwN589tYvPU_Ks748MZUUa8)
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?
from velite.
Note my usage in PR:
const Component = lazy(() => import(`@/registry/components/examples/${component}`))
You cannot extract this path into a variable, as this will prevent the compiler from finding it properly.
from velite.
@dillionverma If there are no more questions, I will close this issue.
from velite.
Related Issues (20)
- Unhandled Runtime Error When using remarkCodeHike HOT 4
- Weird Page Freeze when Navigating via Table of Contents Links HOT 1
- Is it possible to use files stored inside github repo? HOT 4
- [feature request] handle contents failing schema validation, or autofixing HOT 8
- Handling relationships HOT 4
- TOC breaking change/broken on latest release HOT 3
- The provided config in #37 resolves warning in dev mode but still present in deployment HOT 1
- Webpack cache warning HOT 2
- Property does not exist on type '{ props: { readonly components?: {} | undefined; }; }' .ts-plugin(2339) HOT 1
- `prepare`, `complete` events access to configuration `output` object HOT 3
- Taxonomy example dev server stops suddenly without error message HOT 1
- Property 'description', 'title', does not exist on type '{ slug: string; } & { slugAsParams: string; }'.ts(2339) HOT 3
- Support for additional metadata in mdx files HOT 2
- Support files with multiple documents (jsonc, yaml) HOT 4
- Schema table of contents cannot read more than 5 headings HOT 1
- Documentation improvement HOT 1
- Bundle MDX example causes "TypeError: Cannot read properties of undefined (reading 'path')" HOT 3
- A Collection defined with `defineCollection` causes a type error when included in `defineConfig`'s `collections`.
- [Feature Request] s.excerpt({ separator: 'preview' }) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from velite.