bzin
November 4, 2019, 10:31pm
1
Hi,
I am working on a setup where I use Craft CMS GraphQL API, Sapper and Svelte to create a site on Netlify. This works fine and the site is already live using this setup, although I am having trouble when I try to make implement the live preview feature of Craft CMS to work using Netlify Dev. I am able to make this feature to work without running netlify dev
. But that means that I can’t set this and test this using lambda functions locally.
I realise that the crash occurs and seems to be related when I embed the site url within an iframe.
This is crucial on how Craft CMS implement its live preview on a headless website. Basically the CMS embeds my url in a iframe, sends me a token and with that I can retrieve the data that I am currently editing.
screenshot of the crash in my bash
perry
November 7, 2019, 7:24pm
4
Hi there, could you file an issue on the cli repo please? then we can prioritize the work. thanks!
1 Like
bzin
November 9, 2019, 3:05pm
5
Thanks for getting back to me.
I will do that
Update
Added as a issue in github
opened 03:31PM - 09 Nov 19 UTC
closed 11:35PM - 13 Apr 20 UTC
<!--
If you are reporting a new issue, make sure that we do not have any duplic… ates
already open. You can ensure this by searching the issue list for this
repository. If there is a duplicate, please close your issue and add a comment
to the existing issue instead.
If you suspect your issue is a bug, please edit your issue description to
include the BUG REPORT INFORMATION shown below. If you fail to provide this
information within 7 days, we cannot debug your issue and will close it. We
will, however, reopen it if you later provide the information.
---------------------------------------------------
BUG REPORT INFORMATION
---------------------------------------------------
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
-->
**- Description of what I am trying to achieve**
I am updating my website www.bzin.net to have a blog and other pages while hosted on Netlify. The webpage uses Craft CMS to get its data and in the frontend the technical stack is Sapper and Svelte. At this moment I am trying to enable the preview feature from the CMS when its on its headless mode. This means that updating my data in Craft CMS I should be able to see current changes on an iframe before trigger a deployment. I am able to see and set this preview if I do not use Netlify dev and if I directly call my API endpoint. Although my intention is to use lambda functions on Netlify so I can do this in a more secure way, without exposing my API and keys in the javascript.
**- Do you want to request a _feature_ or report a _bug_?**
bug
**- What is the current behavior?**
`netlify dev` breaks when url of project is loaded in an iframe.
**- If the current behavior is a bug, please provide the steps to reproduce.**
1 - run `netlify dev`
2 - open the dev url in a browser where its in an iframe
See attached screenshot:
<img width="934" alt="Screen Shot 2019-11-04 at 11 15 57 PM" src="https://user-images.githubusercontent.com/382735/68530817-4b894680-030c-11ea-83a9-338dc7854469.png">
PS: This was posted from a suggestion in https://community.netlify.com/t/netlify-dev-crashes-when-using-url-in-an-iframe/4738/4
**- What is the expected behavior?**
to be able to continue developing when opening the url in an iframe.
**- Local Environment Information**
**_System:_**
OS: macOS 10.15.1
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
**_Binaries:_**
Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
Yarn: 1.19.0 - /usr/local/bin/yarn
npm: 6.12.1 - ~/.nvm/versions/node/v12.4.0/bin/npm
**_Browsers:_**
Chrome: 78.0.3904.97
Firefox: 69.0.1
Safari: 13.0.3
1 Like