Not able to inject the node module CSS of ReactFlow library #305
Replies: 2 comments
-
A possible solution from Dev channel from Discord and from Chat GPT🧠 Conclusion for ReactSvelte handles CSS-in-JS internally through ✅ Solution for React: Use a CSS PluginYou need to install and configure a plugin like ✳️ Recommended Quick FixIf you only need to support global CSS imports like: import '@xyflow/react/dist/style.css'; You can do it with: 🔧 1. Install CSS loader plugin:npm install --save-dev esbuild-plugin-css-modules 🔧 2. Update your
|
Feature | Svelte Project | Your React Project |
---|---|---|
CSS handling | Done via esbuild-svelte plugin |
Needs esbuild-plugin-css-modules plugin |
Style scope | Managed via Svelte compiler | Manually scoping or lazy-loading suggested |
ReactFlow styles | Already handled via style.css |
Must be imported manually or copied over |
Let me know if you want me to generate the updated working esbuild.config.mjs
file for your React plugin based on the current setup.
Beta Was this translation helpful? Give feedback.
-
PromptActually, the above solution is reading the CSS from the node module and putting it inside main.css file present in the root of the project. But Obsidian doesnt make use of this main.css file. It only uses styles.css file. Will it be possible to append the whole CSS injected into this styles.css file? SolutionAh, thank you for that important clarification. You're absolutely right — Obsidian only recognizes ✅ GoalEnsure that styles from external libraries (like ✅ Solution: Manual CSS Extraction and Appending to
|
Need | Solved? |
---|---|
Import and bundle node module CSS | ✅ Using @import in bundle.css |
Output CSS into styles.css | ✅ Esbuild writes final CSS to it |
Compatible with Obsidian | ✅ Obsidian reads styles.css |
Let me know if you’d like me to generate these config files for you based on your current project layout!
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone!
I am new to this community and for past two days, I spent exploring the docs and this server to figure out what is actually I am doing wrong. After couldn't able to solve the error, finally decided to create this topic here.
The issue is simple, I am not able to interact with the rendered canvas. The nodes are kind of have been rendered as rectangles (I will need to do some fixing, I guess, to properly render the react component inside the nodes). But I cant able to interact with the canvas at. Not able to scroll, pan and move the view, using left mouse or middle mouse button nothing. Even I am not able to click on the React flow link rendered inside the view, just below the Minimap and also cannot able to see the 4 control button properly. Their only outline is visible, but looks like they have not been rendered properly. As can be seen in the below image.

My guess, is the CSS which this module talks about in the docs as well, has not been properly loaded. Because I am also getting the below warning inside the Developer tools window.

Can anyone help me figure out what's actually the issue here.
It will be great if anyone can go through the code, if the issue is specifically related to my plugin project.
Project link : https://github.com/tu2-atmanand/Task-Board/blob/feat-301/canvas-view/src/components/CanvasView.tsx
Beta Was this translation helpful? Give feedback.
All reactions