Skip to content

serverConfig load: works locally, but not when the build is pushed to it's AWS S3 Host. #182

Open
@michaelcuneo

Description

@michaelcuneo

Describe the bug

A clear and concise description of what the bug is.

Not sure if this is a bug, or just a usage problem.

I have quite an editor with a react FilePond component inside for uploading images to an AWS S3 stack. Adding, and Deleting from this S3 Stack using the FilePond works fine...

Editing works fine but only locally.

If I want to edit my file, I use this following setup.

const serverConfig = {
    load: (source, load) => {
      const myRequest = new Request(source);

      fetch(myRequest).then(response => {
        response.blob().then(myBlob => load(myBlob));
      });
    },
  };
<FilePond
   id="file"
   name="file"
   key="file"
   ref={filePondFeature}
   files={values.file}
   instantUpload={false}
   server={serverConfig}
   upload="false"
   onClick={() => setFieldTouched('file', true)}
   onChange={() => setFieldTouched('file', true)}
   oninit={() => setFieldValue('file', file.file)}
   onupdatefiles={fileItems => {
      const thisFiles = fileItems.map(
         thisFile => thisFile.file,
      );
      setFieldValue('file', thisFiles);
      fileItems.map(thisFile =>
         handleAddFeatureFile(thisFile.file),
      );
    }}
/>

Logs

Running the project locally while in development, I get images loaded externally into the FilePond component perfectly fine.

As you can see the Logs show a blob: with data.

image_load
image_load_2

The exact same app, built and hosted online on an AWS S3 Stack doesn't give me any blob at all.

If I log the source locally, I get an appropriate response with an amazon S3 endpoint and URL and credentials for the image I need to load. then I log the blog object and I get an appropriate blob response.

storage_master

I can't get any kind of log from the remotely hosted side because it's obviously not allowing console.log's or alerts.
Not sure how to troubleshoot the other end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions