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

Error: div[style]:1:3: property missing ':' error while yarn build #24

Closed
rahulsuresh-git opened this issue Jan 20, 2021 · 14 comments
Closed

Comments

@rahulsuresh-git
Copy link

rahulsuresh-git commented Jan 20, 2021

While performing a yarn build, I get this error. Not descriptive enough, can anyone assist?
The site loads perfectly when I run it locally.

image

Thanks.

@styxlab
Copy link
Owner

styxlab commented Jan 20, 2021

I can't reproduce this issue.

Please check, if you still run into this problem after the recent project updates. If the problem persists, I will need a reproduced example and a link to it. Please start from a clean clone and make sure you don't mix npm and yarn.

@rahulsuresh-git
Copy link
Author

Yes, I understand it is hard to look at it without any reproduce :|
But, looks like this happens only when I try to fetch content from my GHOST instance. Doesn't happen while fetching from the default ghost data.
Not sure, if anything in the content can cause it to break like this.

Have tried cleaning cache and using yarn in a clean state, but still seems to happen.

@styxlab
Copy link
Owner

styxlab commented Jan 21, 2021

Thanks for the additional info. Could you please create temporary API keys in your Ghost Admin and publish them here, so I can source your content and get a chance to analyze it further?

@styxlab
Copy link
Owner

styxlab commented Jan 21, 2021

I cannot reach your Ghost CMS under https://www.crio.do/blog. Please paste exactly the URL that is shown in Ghost Admin under Integrations.

@styxlab
Copy link
Owner

styxlab commented Jan 21, 2021

Sorry, there was a typo on my end. Am now able to reproduce the issue!

@rahulsuresh-git
Copy link
Author

rahulsuresh-git commented Jan 21, 2021

Phew! :) Let me know if you need anything else from my side.

@rahulsuresh-git
Copy link
Author

Just an heads up, I tried your gatsby monorepo as well, but it seems to work perfectly!
No such errors.

@styxlab
Copy link
Owner

styxlab commented Jan 21, 2021

There were two issues that I solved with the latest merge:

  1. Your Ghost installation seems to be on an older version where the Content API does not throw an error, if a page is not found. I had to adapt the code to cater for this different behaviour of older APIs.

  2. The div[style] error occurred on elements with custom styling and has been fixed too.

I hope your site is now compiling fine (it is on my local machine).

By the way, your blog site is really nice, how do you create these awesome feature images? Continue that topic on twitter?

@rahulsuresh-git
Copy link
Author

rahulsuresh-git commented Jan 22, 2021

Thank you @styxlab!
It works now. The only thing where I would require help is, when I try running next export, it says "Error: Image Optimization using Next.js' default loader is not compatible with next export"
Is there a way to disable these image optimisations?

Also, thanks for the appreciation. I will continue the conversation on twitter :)

@styxlab
Copy link
Owner

styxlab commented Jan 22, 2021

Yes, you can turn image optimizations off in appConfig.js:

// Images
export const nextFeatureImages: boolean = true
export const nextInlineImages: boolean = true

Default is true but you can set it to false.

@rahulsuresh-git
Copy link
Author

Flipped them to false, still fails with the same error :(

@styxlab
Copy link
Owner

styxlab commented Jan 22, 2021

There seems to be an issue that image optimization cannot be fully turned off in Next.js which currently inhibits next export. See https://github.com/vercel/next.js/discussions/19372 for further details. Once there is a concise way to switch off the image optimization, I will incorporate it here. May I ask you why you need next export?

@rahulsuresh-git
Copy link
Author

Oh okay. So I want to host the website in an S3 bucket, and I guess next export will generate those build files which I can use for hosting the site. I do not want to do a SSR.

@styxlab
Copy link
Owner

styxlab commented Jan 22, 2021

Thanks. Will close this thread because I don't want to blur the initial topic. Will open a new one for 'next export'.

@styxlab styxlab closed this as completed Jan 22, 2021
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

2 participants