You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have posted also an issue here (payloadcms/custom-field-guide#2) but I think it's a bug in payload self.
Or I am implementing it wrong but then the docs need to be updated.
I also get the bug in v0.7.4
The text was updated successfully, but these errors were encountered:
matthijs166
changed the title
Stylesheets of custom components can't resolve for custom components on fields
Stylesheets of custom components can't resolve on fields
Aug 2, 2022
Hey @matthijs166 — this is actually due to your TypeScript build process and is a common problem that TypeScript projects often face.
The jist of this is that when you build a TS project, tsc or whatever you're using copies all TS / JS files used into your /dist folder or wherever you're building to. But, in your src folder, you might have other files that also need to be copied over, like scss, svg, etc.
You need to use copyfiles or similar to copy those files too, if this applies to you. You can see in our public demo build process where we use copyfiles to copy all non-TS / JS files to /dist at build-time.
Do that, and you'll be good. In the meantime, we'll update our create-payload-app to automatically include this step so others don't have the same issue.
I'm going to convert this to a discussion because I think it will help others out!
Bug Report
I implemented https://github.com/payloadcms/custom-field-guide and get an error on build
Error: Cannot find module './styles.scss', its the stylesheet of a custom component.
Expected Behavior
That the build doesn't fail when I include custom stylesheets
Current Behavior
When I run payload dev everything works fine but the moment I'm building the project it crashes
Steps to Reproduce
I have posted also an issue here (payloadcms/custom-field-guide#2) but I think it's a bug in payload self.
Or I am implementing it wrong but then the docs need to be updated.
I also get the bug in v0.7.4
The text was updated successfully, but these errors were encountered: