generate:types Unknown file extension ".png" error #10347
Replies: 2 comments
-
Looks like payload uses native TS import to import the config. I can see two options based on this analysis:
I prefer the first option, as the second option eliminates image optimizations (I think). So if I use huge images, the editing experience might suffer? |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm converting this to a discussion as I wouldn't consider this a bug in payload. Maybe a feature request ("should be possible to import image files from other folders than /assets for better project structure and to leverage image size optimizations"), though that'd belong to GH Discussions as well. The Payload Config, by us, is treated as and expected to be 100% node-safe. Getting anything that's not node-safe to work would be the responsibility of the user => thus not an "issue". Related: #6938, https://github.com/payloadcms/payload/releases/tag/v3.0.0-beta.79 |
Beta Was this translation helpful? Give feedback.
-
Describe the Bug
Importing a *.png file in a block works fine, except when the need arises to regenerate the types.
This issue is the exact same issue as #7927, except some further clarification on the issue is required.
In my opinion, it should be possible to import image files from other folders than
/assets
for better project structure and to leverage image size optimizations.Link to the code that reproduces this issue
https://github.com/benjaminpreiss/payload/tree/main
Reproduction Steps
Use node 20!
cd png-test
Which area(s) are affected? (Select all that apply)
Not sure
Environment Info
Beta Was this translation helpful? Give feedback.
All reactions