-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Bundler error when installing packages via npm that contain react package #317
Comments
After trying all day. I decided to clone the mantine repo. Pair it down to the essentials and take 1 component and convert it to pigment-css. It works (in dev mode). Tomorrow I will see whether I can make an npm package and see what the result is. After that. I'll do a postmortem and see if I can find anything. I can't understand why my other repos just don't work in dev nor pushing to npm. But then I have 1 repo which does work in dev and not when pushing to npm. What's the issue here? 🤔 |
Just tried with the latest version v0.0.27. Going to take a step back from this. I'm just not able to solve it or debug this at all. |
If using a Pigment CSS package in your library, you need to tell pigment to transform code from node_modules for your library. By default, any code from pigment({
theme,
transformLibraries: ["@charizardxx/core"],
}) If other packages also use Pigment CSS API, you can just specify |
@brijeshb42 Thank you! This has cleared the issue. I'm very new to Vite and never saw this in my googling. 😩 Edit: Please update the Vite documentation. I completely missed that the NextJS config had this and for whatever reason I was blind to it. 😦 One new issue however. When vite starts up:
Might be worth adjusting that for those who aren't using MUI. Thanks |
Steps to reproduce
Clone repo: https://github.com/paulm17/charizardxx-app
Current behavior
The error:
Despite it being in use.
Remove the "charizardxx" UI lib and pigment-css will continue to operate just fine. The issue is for whatever reason, the pigment-css/react page is perhaps running before the vite-plugin package?
I have also tested this with nextjs and I have the same issue. (can create next repo, if requested)
Expected behavior
There should be no bundler error.
Context
I have built a custom UI library to be built installed via npm.
A minimal production of the UI library using pigment-css is here:
Search keywords: rollup, build process
The text was updated successfully, but these errors were encountered: