voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.71k stars 504 forks source link

broken build with npm3 (was: Cannot add any image either inside a template block or the gallery 2) #427

Closed lanceC-hub closed 6 years ago

lanceC-hub commented 6 years ago

Hi, I have read "Are you having issues with Mosaico?". W10, node v6.11.3, npm 3.10.10 Perhaps similar to #frufin last week, I successfully installed mosaico locally w10 box. The application served on 127.0.0.1:9006, i can also edit anything from templates, but when i try to add any image, i don't see in the chrome or FF consoles network tab the POST upload or GET xxx.png (or xxx.jpg) as with https://mosaico.io/editor...

i get the following errors

Chrome 64 ->jquery.js:3818 ( x6 ) jQuery.Deferred exception: Cannot read property 'parseMetaData' of undefined TypeError: Cannot read property 'parseMetaData' of undefined at N.(anonymous function).(anonymous function).loadImageMetaData (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:418952) at N.(anonymous function).(anonymous function).n (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:414547) at e (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29181) at t (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29483) undefined

Chrome 64 ->jquery.js:3818 ( x3 ) jQuery.Deferred exception: Cannot read property 'undefined' of undefined TypeError: Cannot read property 'undefined' of undefined at N.(anonymous function).(anonymous function).validate (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:420306) at n (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:414547) at e (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29181) at t (http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29483) undefined

Firefox 59 -> jquery.js:3818:2 ( x1 ) jQuery.Deferred exception: l is undefined loadImageMetaData@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:418950 n@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:414520 e@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29179 c/</t<@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29483 undefined Firefox 59 -> jquery.js:3818:2 ( x1 ) jQuery.Deferred exception: e.index is undefined validate@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:420297 n@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:414520 e@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29179 c/</t<@http://127.0.0.1:9006/rs/mosaico-libs.min.js?v=0.17.1:12:29483 undefined

Thanks in advance for help.

bago commented 6 years ago

Do you have ImageMagick installed? Do "convert" cmd on the command line of a random folder return ImageMagick help? Can you add the output of the console where you executed the grunt command?

lanceC-hub commented 6 years ago

Hi Bago, PS D:\mosaico> convert Version: ImageMagick 7.0.7-26 Q16 x86 2018-03-12 http://www.imagemagick.org Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Visual C++: 180040629 Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml zlib Usage: convert.exe [options ...] file [ [options ...] file ...] [options ...] file

Image Settings: -adjoin join images into a single multi-image file...

lanceC-hub commented 6 years ago

PS D:\mosaico> grunt Running "googlefonts:noto" (googlefonts) task

1 font downloaded.

Running "copy:res" (copy) task Created 6 directories, copied 40 files

Running "copy:root" (copy) task Copied 1 file

Running "copy:htmls" (copy) task Copied 2 files

Running "copy:fontawesome" (copy) task Copied 5 files

Running "uglify:deps" (uglify) task

1 sourcemap created. 1 file created 2.4 MB → 904.14 kB

Running "cssmin:deps" (cssmin) task

1 file created. 397 B → 359 B

Running "jshint:all" (jshint) task

√ No problems

Running "combineKOTemplates:main" (combineKOTemplates) task

Running "browserify:main" (browserify) task

1034562 bytes written (2.42 seconds) Bundle build/mosaico.js created.

Running "exorcise:main" (exorcise) task Exorcising source map from build/mosaico.js

Running "less:css" (less) task

2 stylesheets created.

Running "postcss:dist" (postcss) task

1 processed stylesheet created. 1 sourcemap created.

Running "postcss:material" (postcss) task

1 processed stylesheet created. 1 sourcemap created.

Running "express:dev" (express) task Starting background Express server Express server listening on port 9006

Running "watch" task Waiting...

bago commented 6 years ago

Can you tell me which version of mosaico (git hash, or release). This sounds like a bug that was in HEAD after the 0.17.0 release and until 1 week ago, before we released 0.17.1.

Can you confirm this happens on the 0.17.1 release you can download here: https://github.com/voidlabs/mosaico/releases/tag/v0.17.1 ?

lanceC-hub commented 6 years ago

Yes, i downloaded this morning, mosaico.min.js?v=0.17.1

bago commented 6 years ago

I just downloaded 0.17.1 from releases, built it, but the column:lines reference you have in your stack trace are meaningless in my build...

can you share somehow your dist/rs/mosaico-libs.min.js and dist/rs/mosaico-libs.min.js.map ?

can you download the dist zip https://github.com/voidlabs/mosaico/releases/download/v0.17.1/mosaico-0.17.1-dist.zip , extract it in your dist folder and the run "grunt server" (so that you run the backend without rebuilding the library and you use the already built library) and report the exceptions stack trace again so the stack will mean something.

lanceC-hub commented 6 years ago

mosaico-libs.min.js.zip here's the old files. But with the extract to dist folder > "grunt server" everything seems to work perfectly.

bago commented 6 years ago

Looks like something is broken in your build.. can you tell me if you have this folder after you did the "npm install" ?

node_modules/blueimp-file-upload/node_modules/blueimp-canvas-to-blob/

If it is missing, can you please try to remove node_modules and restart the "npm install" command and look at that folder again to see if you keep repeating the issue?

Thank you!

bago commented 6 years ago

Don't mind! I tried running the build on Npm 3 and I got the same broken result. It seems our latest refactoring broke the npm3 compatibility and it now works only with npm5.

We either have to fix it or document the npm5 requirement! Thank you for reporting!

lanceC-hub commented 6 years ago

All is ok with npm 5.6.0 Thank you for you prompt help & thank you for a fantastic application.