GithubHelp home page GithubHelp logo

Comments (7)

MudassarSandhu avatar MudassarSandhu commented on July 28, 2024

@eugenio165 Have you solved yet?
@artf Any idea why this is happening? I am also facing this issue.

Screenshot 2020-10-26 at 12 38 35 PM

Screenshot 2020-10-26 at 12 38 55 PM

from preset-webpage.

eugenio165 avatar eugenio165 commented on July 28, 2024

@MudassarSandhu Yes, unfortunately i had to disable aot and buildOptimizer on my prod build...
If you find a better solution, update me please, thanks

from preset-webpage.

MudassarSandhu avatar MudassarSandhu commented on July 28, 2024

Yeah, i did find a solution which fixed my error. How are you importing and initializing the grapesjs-preset-webpage plugin?
Use the old method like

import grapesjs from 'grapesjs';
import 'grapesjs-preset-webpage';

And in the initialization of builder

plugins: ['grapesjs-preset-webpage'],
      pluginsOpts: {
        'gjs-preset-webpage': {
        },
      }
}

Add the grapesjs script and plugin script in angular json file in scripts tag like this
But order matters if you have any other script in the scripts tag

"scripts": [
    "./node_modules/grapesjs/dist/grapes.min.js",
    "./node_modules/grapesjs-preset-webpage/dist/grapesjs-preset-webpage.min.js",
]

from preset-webpage.

eugenio165 avatar eugenio165 commented on July 28, 2024

I see... so you can build with prod configurations like that? You didnt have to use my fix (disable AOT and Optimization)?

My implementation is exactly like yours, but my grapesjs scripts aren't the first in the array in the angular json file. I'm too busy currently to go back and try to play around with the project i used this on, but once i have time i'll go check if placing the grapesjs scrips first in the array allows me to build with AOT and Optimization.

from preset-webpage.

MudassarSandhu avatar MudassarSandhu commented on July 28, 2024

@eugenio165 yeah i can build with prod configurations. In my project's anular.json file, grapesjs is not the first. I have imported other scripts but i showed you that as an example.

from preset-webpage.

eugenio165 avatar eugenio165 commented on July 28, 2024

@MudassarSandhu Just to be clear, i can build with prod configurations, but i'll get the error i stated in this issue. When i build without AOT and BuildOptimizer, this error doesnt occur. My implementation is EXACTLY like yours, the only thing that could differ is the order of the scripts array, and maybe the order of the imports in the file i use grapesjs in.

When you build in prod, does grapesjs work correctly?
Thanks mate

from preset-webpage.

artf avatar artf commented on July 28, 2024

For now, I'm closing this as I can't reproduce it, but if you believe the issue is still there, please create a reproducible demo.

from preset-webpage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.