front / gutenberg-js

JavaScript only version of the WordPress Gutenberg editor (DEPRECATED)
GNU General Public License v2.0
390 stars 42 forks source link

Production build error (React) #18

Closed botoxparty closed 5 years ago

botoxparty commented 5 years ago

When running a production build I get:

Uncaught TypeError: Super expression must either be null or a function, not undefined

at gutenberg-js.js:6520
    at gutenberg-js.js:6519
    at gutenberg-js.js:6504
    at Object.<anonymous> (gutenberg-js.js:26733)
    at n (gutenberg-js.js:17)
    at Object.<anonymous> (gutenberg-js.js:82448)
    at n (gutenberg-js.js:17)
    at Object.<anonymous> (gutenberg-js.js:34453)
    at n (gutenberg-js.js:17)
    at Object.<anonymous> (gutenberg-js.js:46974)
arnvanhoutte commented 5 years ago

I think this is similar to this: https://github.com/front/gutenberg-js/issues/14

botoxparty commented 5 years ago

Indeed it is, wouldn't really want to turn off optimisation though.

How would I go about debugging this?

botoxparty commented 5 years ago

Running npm build for the @front/g-editor also produces the same result.

https://www.npmjs.com/package/@frontkom/g-editor

arnvanhoutte commented 5 years ago

Have you find a way to fix this?

botoxparty commented 5 years ago

No, I would need sourcemaps for gutenberg-js.js

arnvanhoutte commented 5 years ago

@SofiaSousa Will this be looked at? Or is this a Wordpress issue?

botoxparty commented 5 years ago

I would be happy to work on the development of this to get it production ready @SofiaSousa if you could point me in the direction of source maps for gutenberg-js.js

Also I feel like this particular error could have something to do with it not registering that React is loaded?

Qoraiche commented 5 years ago

I would be happy to work on the development of this to get it production ready @SofiaSousa if you could point me in the direction of source maps for gutenberg-js.js

Also I feel like this particular error could have something to do with it not registering that React is loaded?

@botoxparty that's would be great!, I hope you get help.

SofiaSousa commented 5 years ago

@botoxparty I'm not sure about what you are asking but you can check the source maps here https://unpkg.com/@frontkom/gutenberg-js@3.0.1/build/js/gutenberg-js.js.map or in gutenberg-js build folder after running npm run build.

Qoraiche commented 5 years ago

@SofiaSousa can you please fix the production error: Uncaught TypeError: Super expression must either be null or a function, not undefined.

we will be very thankful

SofiaSousa commented 5 years ago

It's probably related with circular dependencies of the @wordpress/gutenberg packages and we probably can't do anything about that in gutenberg-js.

botoxparty commented 5 years ago

@SofiaSousa so do you get this same error? Are the current contributors going to continue working on this project or has it been abandoned?

Qoraiche commented 5 years ago

@SofiaSousa so there is no way to build? development server works fine for the g-editor but the build doesn't. any trick?

thanks again for your help

SofiaSousa commented 5 years ago

As @arnvanhoutte suggested at g-editor/issues/4:

At the moment: turning optimizations off.

Project is not abandoned, but solving this is not a priority. If you want to suggest a solution please create a pull request.

Qoraiche commented 5 years ago

@SofiaSousa i think it's Impossible/Difficult to use gutenberg-js in a production environment since the production build produces an unsolvable error! what is your solution? Thanks again

Qoraiche commented 5 years ago

This error has been fixed in the new update of g-editor.

arnvanhoutte commented 5 years ago

Excuse me if I have been getting this wrong, but the fix there seems to be to turn compression off: https://github.com/front/g-editor/commit/7e742d1e4bd91342d3ac6755a4aa00dae166b3be

I don't really see that as a fix, but more like a temporary workaround

Qoraiche commented 5 years ago

@arnvanhoutte , I think they can not fix this issue directly because it's caused circular dependencies inside Gutenberg itself. the only solution is to disable compression on the TerserPlugin front/g-editor@7e742d1.