Open BolajiAyodeji opened 1 year ago
While I wait for further comments from anyone, I discovered that the exported JSON file with the assets lists all the assets from Contentful's CDN so you don't need to set uploadAssets: true
and a file path since the import process will just import the assets. Doing this resolves my errors but this process is still unclear in the docs and developer experience. Ideally I'll expect a better error message to tell that you shouldn't use uploadAssets: true
with and export file of CDN assets if this is the normal behaviour instead of proceeding.
Also the assets and all entries are still imported in draft mode even though the process is successful.
Hi everyone (cc: @Khaledgarbaya).
I'm not sure if this is an unexpected behaviour from your end but I run into the error below when I try to import asset files that were previously exported using
contentful-export
:When I ran the export command first, the library automatically exports the files to a
/images.ctfassets.net/<space id>/<list of all children folders here>
. Now in my import script, I use the/images.ctfassets.net
base as theassetsDirectory
but I kept running into the error above which shows you have added anotherimages.ctfassets.net/
to the file path. Usually the files still gets imported which is weird but the publish process doesn't work (even though it shows green in the CLI). All assets files and even entries remain in draft mode and the import process returns all the errors before timing out:A quick look at the assets import task show that you are joining the split file path with the passed
accessDirectory
which I presume is leading to the incorrect final file path. It's unclear how this process works with your library but something isn't working as expected.Expected Behaviour
I expect that if I pass
assetsDirectory: "./images.ctfassets.net"
and run my script using the exact previously exported data, the import should succeed without any errors and all entires published. Am I missing anything here or is there something wrong with the library, please? Your docs doesn't explicitly explain what theaccessDirectory
path should look like so I'd assume there's no specific requirement here and a normal path used should work. It's quite frustrating to have to manually publish imported entires/image assets and force the multiple users that will use my import script to run into the same issue.Thank you.