-
Notifications
You must be signed in to change notification settings - Fork 52
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
Designer not loading #91
Comments
Thank you!! This is your first issue on this repo |
Hi @evilRat ! You should RTFM ;-) :
|
Can you post whole file?. Because I have this
and without any success |
i am facing this same issue and I wonder why this issue was closed |
Hello guys! Here is the code that worked for me. You can find more instrucctions direcly on npm strapi-plugin-email-designer docs |
Hi @A330454 I am trying to get this working with Strapi v4.20.1, Chrome. RTFM, etc. but am still getting a refusal on editor.unlayer.com (attached). Does your snippet work with the latest? Thanks. |
Hey @tbfcannon ! I understand you're encountering issues with CORS when trying to integrate with Strapi v4.20.1 and accessing https://editor.unlayer.com/embed.js. The refusal you're seeing is likely due to the CORS policy not being properly configured to allow requests from your domain. To address this issue, you'll need to ensure that your CORS configuration in Strapi allows requests. Here's an updated config/middlewares.js configuration that specifies the necessary CORS settings and also configures the Content Security Policy (CSP) to allow scripts and frames from editor.unlayer.com:
Additionally, here's an overview of my package.json dependencies for reference, ensuring compatibility with your Strapi version:
Please try adjusting your configuration as suggested and let me know if it resolves your issue. I'm here to help if you have any further questions or need assistance. Best regards. |
Hey @tbfcannon ! I'm genuinely thrilled to hear that my suggestions have been of help to you and that you're making progress with your project. It's always rewarding to see positive outcomes from collaborative efforts, keeping me updated on your journey. After a more thorough review of your middlewares.js configuration and considering the additional context you've provided, I've identified a few more points that might help you troubleshoot the issues you're experiencing further:
You middlewares.js config file should look like this
I'm here to assist if you have any more questions or need further clarification on any point. I'm looking forward to hearing about your continued progress. Please don't hesitate to reach out; I'll be awaiting your input and any updates on your side. Best regards and happy coding, |
@A330454 thank you for the time you've spent on this. I created a clean project following your instructions, cleared my browser cache and still get CORS errors when I try to create a new template. I tried the security policy specified in #140 and was able to run the designer without using unsafe-inline. I still get CORS errors. BTW, I went to unlayer.com and checked my browser console while trying their email template designer: CORS ERRORS. Go to https://dashboard.unlayer.com/create/blank?ref=templates and your browser console will show the same CORS errors I reported in my earlier comment. I also looked at https://editor.unlayer.com/1.5.61/editor.js and noticed the use of "allocUnsafe" in there. My limited understanding is that the use of unsafe presents a risk of injection but the Strapi security policy controls which origin can do injection. https://snyk.io/advisor/npm-package/react-unlayer-editor#package-footer states that unlayer has no known security issues. It's nice to see the designer working in Strapi but I do not believe my team will approve usage given the CORS issues. Thanks again! |
I'm also experiencing this issue our middlewares.js file looks exactly as the example above and get the same exact error regarding 'unsafe-inline'. |
this was the solution for me from here: I need to add editor.unlayer.com/embed.js to the script-src directive |
There is no content in HTML Version tab ...it shows blank page
The text was updated successfully, but these errors were encountered: