0
votes

I create my custom theme, build it and everything goes right. But When I copy the default theme files (css, js, images etc) to my custom-theme src and deploy it, some error shows up:

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: missing '{' near line 1:24577
    at error (C:\Users\DanielKęska\web\themes\sym-theme\node_modules\liferay-css-parse\index.js:69:15)
    at declarations (C:\Users\DanielKęska\web\themes\sym-theme\node_modules\liferay-css-parse\index.js:225:25)

...there is much more of it :( Thanks for help!

2
"near line 1:24577" sounds like you're getting this in the minified version. Clearly nothing that you'd like to debug in. To properly debug, you should enable Liferay's developer settings and try again. Make sure to copy the non-minified versions of the files, so that this operation makes sense.Olaf Kock
Sory, I'm new in Liferay so maybe it's a silly question, but in which portal-ext file I should disable minifying? In my theme's folder or in local server? I have many these files.danny
That would be in the server. However, I might have been misguided (I've not had my hands on themes in 7.1): It looks like this error message comes before this component is deployed on a server (?) - at least the file paths don't look like this is in a running server. Anyways: Check if you have included a minified file (e.g. single line with more than 24000 characters) and find a non-minified (e.g. readable) version of that file. But any way: I guess I'm out - sorry. Hope someone else with current theme-experience finds this.Olaf Kock

2 Answers

1
votes

2 things here, you normally do not copy from the classic theme or from any theme that you can declare as a parent.

When you build your theme, the building tool will include the files for you. If the parent is another theme and you are copying from a theme that is not the parent, that aggravates the problem, as you cannot expect the JS or even CSS files to be compatible. The templates can use different classes, the JS can have different dependencies or logic that is completely not related... it is a mess.

Judging by the node_modules\liferay-css-parse directory in your path, you got yourself a parsing error when building the theme. That is different from what is suggested on the comments, as it is not a runtime issue.

So, basically you have a procedure problem: do not directly copy files, and do not mix: if the parent is a theme, and you copy from another theme, the expectation is a broken result. You can override though.

0
votes

Late answer, but here it goes anyway: You probably copied the built css files (like main.css) too. These are created when building the theme and should not be present in the src folder.