Skip to content
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

Can't upload images in editor. #142

Open
DS-ON opened this issue Apr 2, 2024 · 1 comment
Open

Can't upload images in editor. #142

DS-ON opened this issue Apr 2, 2024 · 1 comment

Comments

@DS-ON
Copy link

DS-ON commented Apr 2, 2024

Bug report

Describe the bug

'Upload Image' button within Image content block is not working. Browser devtools show event listener as an empty function.

Steps to reproduce the behavior

  1. Go to 'Content' tab
  2. Drag 'Image' block in to editor
  3. Click image to open 'Image' dialog and click 'Upload Image' button
  4. Nothing happens

Expected behavior

The button should open a file browser or drag & drop file input.

Screenshots

Button event listener:

image

editor.js in sources panel showing Qr():

image

Code snippets

Strapi security middleware configured as per docs. Also set 'unsafe-inline' and CORS origin to '*' for troubleshooting purposes:

{
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
            "cdn.jsdelivr.net",
            "strapi.io",
            "s3.amazonaws.com",
          ],
          "media-src": ["'self'", "data:", "blob:", "market-assets.strapi.io"],
          "script-src": [
            "'self'",
            "'unsafe-inline'",
            "editor.unlayer.com",
            "editor.unlayer.com/embed.js",
          ],
          "frame-src": ["'self'", "editor.unlayer.com"],
        },
      },
    },
  },
  {
    name: "strapi::cors",
    config: {
      headers: [
        "Content-Type",
        "Authorization",
        "Accept",
        "Origin",
        "Cache-Control",
        "Pragma",
      ],
      origin: "*",
      methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
      credentials: true,
    },
  },

System

  • Node.js version: 18.17.0
  • NPM version: 9.6.7
  • Strapi version: 4.21.1
  • Plugin version: 2.2.1
  • Database: postgres
  • Operating system: Pop!_OS 22.04 LTS
Copy link

github-actions bot commented Apr 2, 2024

Thank you!! This is your first issue on this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant