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

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

Closed
lanceC-hub opened this issue Mar 16, 2018 · 10 comments
Assignees
Labels
Milestone

Comments

@lanceC-hub
Copy link

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
Copy link
Member

bago commented Mar 16, 2018

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
Copy link
Author

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
Copy link
Author

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
Copy link
Member

bago commented Mar 16, 2018

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
Copy link
Author

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

@bago
Copy link
Member

bago commented Mar 16, 2018

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
Copy link
Author

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
Copy link
Member

bago commented Mar 16, 2018

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 bago added the bug label Mar 16, 2018
@bago bago self-assigned this Mar 16, 2018
@bago bago added this to the 0.17.2 milestone Mar 16, 2018
@bago
Copy link
Member

bago commented Mar 16, 2018

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!

@bago bago changed the title Cannot add any image either inside a template block or the gallery 2 broken build with npm3 (was: Cannot add any image either inside a template block or the gallery 2) Mar 16, 2018
@lanceC-hub
Copy link
Author

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

@bago bago closed this as completed in 48b516f Mar 19, 2018
Hiswe added a commit to abernier/mosaico-backend that referenced this issue Sep 1, 2018
* More conditions for scrollfix.js

Fixes voidlabs#374 . Should work with any 4+ version of tinymce.

* Dependency updates + ko 3.4.2 compatibility

Updated build/dev (npm/bower) dependencies + add ko 3.4.2 support for
subscriptions tracking.

* Modified README with link to ASP.NET Core backend

* Modified README with link to ASP.NET MVC 5 backend

* Revert ko-reactor to 1.3.9 + Embed ko-undomanager and ko-wrap

Fixes voidlabs#407 and voidlabs#408

* Move away from bower. Switch to plain npm

Fix voidlabs#409

* Move away from bower. Switch to plain npm

Fix voidlabs#409

* Added reference to Rails engine

* Force jquery-ui 1.11 because of jquery-ui 1.12 not being compatible

There are quirks with jquery ui 1.12 that introduced incompatibilities and knockout-jqueryui doesn't deal with them.

* Fix specs according to bower removal refactoring

* Fixes for bower removal

* Minor change trying to debug a weird issue with npm on CI tools

* Update dev dependencies

* Fix travis declaration (we don't support node 5, but we support node 6, 7 and 8)

* Use jquery3+jquery migrate instead of jquery 1.12 (security issues)

* Forgot a change in the jquery 3 upgrade

* Depdendencies update (ko 3.4.2, reactor 1.4.0, ko-sortable 1.0.0)

Support for ko 3.4.2 and ko 3.5.0-beta (both in our code and by upgrading ko-reactor to latest 1.4.0 release).

Update to jquery ui 1.12 includes even if we stick to jquery ui 1.11 for compatibility reasons so we can easily bundle the latest ko-sortable version (that moved to the newest release)

Another attempt to fix voidlabs#379

* Updated jasmine to 3.0.0 + added grunt clean task

* Basic wrapper/undomanager spec

Include commented code for "known failing tests"

* Replace knockout-wrap with a simple adhoc function

Fix voidlabs#408

* grunt-contrib-clean is a dev dependency, not a runtime dependency

* build fixes + package-lock update

* Update versafix to 1.1.16 release from the versafix-template project

Versafix now have its own repository:
https://github.com/voidlabs/versafix-template

* Move to official evol-colorpicker npm (new releases merged our PR, so we don't need a fork anymore)

+ also fixed a comment in the colorpicker integration code.
Complete the fix for #3

* Added community links to README

* Reduce logging + Prepare 0.17 release

Translated a missed italian log, moved to console.debug for some very verbose logging.

* Logging improvements

* Switch back from console.debug to console.log

Console.debug is not available in node < 9 nor in some browsers.

* Add license banner + Grunt compress task to make the binary release asset

Also simplify the browserify build to avoid double builds.

* Show debug where console.debug is available, otherwise mute it.

* Automatically inject package version number in the code during the build

* Added grunt release task

* Testing grunt release plugin

* release 0.17.0

* Explicit bin naming for the release assets

Skip npm publishing during release.

* New license_check grunt goal + new dist goal.

* Fixes with test popup prompt

1) Edge Metro doesn't have a prompt method
2) When closing the window without email addresses this produced an error and stuck the button.

* Minor fixes for package.json

* Minor fixes to grunt release and lib minification size

* Merge external dependencies to a single js+css file

* Make "dist" folder more comprehensive

* Moved index/editor.html to src folder

* use passive events by default + sourcemaps for dependencies bundle

* wysiwyg/tinymce: add debug option + default to "br" newlines on short texts.

* Rename droppable binding to avoid name clash

knockout-sortable 1.1.0 introduced its own droppable binding. It is not compatible with our needs, so we prefer to rename our binding, instead of overwriting the original binding with our code.

* Fast fail on unsupported jqueryui version

jquery ui 12 introduced backward incompatible changes. Our dependency (knockout-jqueryui) only supports 1.08 to 1.11, so we stick to 1.11

* we now supprot latest ko-sortable (bump devdependencies)

* Attempt to catch some tinymce exceptions

* DOWNGRADE tinymce to 4.5.8 + Fix for ko-sortable 1.1.0 support

We experienced major random issues with TinyMCE 4.6.0+ (including latest 4.7.9), so we downgrade to the latest "stable" release.

* Update README.md

* Fix order for deps being bundled

Fix voidlabs#421
Also removed explicit dependency on load-image/canvas-to-blob as we get them via file-upload.

* Support quoted strings in template language declarations

Fix voidlabs#391

* revert test changes

* deal with both JSON and JS for the data parameter during startup

* avoid use deprecated properties to detect webkit

* use debug for expected exceptions

* trim options key/labels for select widget

* Missing localization string for gallery paginator

* placeholder for pt_BR lang

* Update mosaico-nl.json (POEditor.com)

* Update mosaico-en.json (POEditor.com)

* Update mosaico-fr.json (POEditor.com)

* Update mosaico-de.json (POEditor.com)

* Update mosaico-it.json (POEditor.com)

* Update mosaico-ru.json (POEditor.com)

* Update mosaico-sr_RS.json (POEditor.com)

* Update mosaico-es.json (POEditor.com)

* Update mosaico-sv.json (POEditor.com)

* Update mosaico-pt_BR.json (POEditor.com)

* Some 3rd party CI conf (appveyor + circleci)

More CI, more environments.

* Trim option keys while dealing with variants

* Cleanup

* Update versafix-1 parsing test + basic variant test

* Coverage test with travisCI

* Testing with travis and codecov

* Docs refactoring

* "dist" is better than "bin"

* release 0.17.1

* Revert build optimization to keep npm3 compatibility

Fix voidlabs#427

* Minor style fixes (sync upstream)

* tinymce binding improvements

You can now configure:
"ko.bindingHandlers.wysiwyg.getContentOptions: {};" in order to use standard getContent instead of "raw" getContent (it could work better) with regard to empty contents (see voidlabs#428 and voidlabs#426).
ko.bindingHandlers.wysiwyg.useTarget to skip creating id attributes for every editable element and run tinymce against the dom element instead of the selector.
Added ko.bindingHandlers.wysiwyg.initializingClass defaulting to "wysiwyg-loading" that will add the class to the element during the tinymce initialization. Also added some CSS to prevent the editable to be clickable during initialization and show a fade animation in that timeframe.

* wywisyg: more options

- new ko.bindingHandlers.wysiwyg.removeSelectionOnBlur option defaulting to "true" that will force browser selection to be emptied when you unfocus an editor (set this to false to revert to the old behaviour).
- new ko.bindingHandlers.wysiwyg.emptyClass option that will add an "wysiwyg-empty" class on contents with no "text" (remove html tags and trims to check this), so you can add CSS to add behaviour. By default no styles are added to this.
- new debug console error when wysiwyg is started on inline elements (inline-block or block support is better)

* Default to inline-block for editable contents and outline them on hover

- Also changed the spacing for mid-tools (editing icons for images).
- Force cursor icon for empty editables.

* Added image tool to browser the gallery

Set viewModel.selectImage to undefined if you want to remove the new icon.
Override viewModel.selectImage to your own function if you want to change the behaviour of this icon.

* Update mosaico-nl.json (POEditor.com)

* Update mosaico-en.json (POEditor.com)

* Update mosaico-fr.json (POEditor.com)

* Update mosaico-de.json (POEditor.com)

* Update mosaico-it.json (POEditor.com)

* Update mosaico-pt_BR.json (POEditor.com)

* Update mosaico-ru.json (POEditor.com)

* Update mosaico-sr_RS.json (POEditor.com)

* Update mosaico-es.json (POEditor.com)

* Update mosaico-sv.json (POEditor.com)

* trivial: package.lock was not updated according to npm3 compatibility refactoring

* Trying to prevent inline-editable to collapse when empty

We use \U2063 that is the unicode for the "invisible separator"/"invisible comma".

* Move debug about inline editable after tinymce have initialized

It raised false positives when ran before.

* extract unused bindings to their own file + extracted preloader to its own file, so to shring fileupload bindings.

* release 0.17.2

* Temporary workaround for voidlabs#430

Simply revert latest CSS changes for webkit browsers (Safari/Midori..).

Those browsers won't show the outline on editable contents while hovering the blocks.

* Avoid opacity "on hover" in Safari/Midori

Attempt to fix voidlabs#430

* Refactor hover/selection effects to deal with webkit (safari) issues

Trying to workaround voidlabs#430

* minor visual tweak for selections

* prevent double tooltips on image upload button (safari/edge)

Hopefully fix voidlabs#432

* Prevent downloading resources while parsing the master template

Attempt to fix voidlabs#433 by using jQuery(jQuery.parseHTML()) instead of jQuery().
This also require jQuery 3+ (on older jquery it will work, but it will temporarily try to download remote resources from invalid urls)

* Move makeEditableHover to style_mosaico.less near the makeSelectable

* release 0.17.3

* Rename dependencies bundle to fix a tinymce issue in IE11

Tinymce tries to find the path for skin resources on its own. On IE11 the "correct" method fails and it tries to detect the folder by searching the tinymce script urls. But we bundled it and it cannot find itself.. so if we name it so it ends with tinymce.min.js this will "fool" it and fix it. Fix voidlabs#459

* Update versafix to 1.1.17

Fix for voidlabs#467

* Add a comment about a broken option

See voidlabs#446

* Update/improve dependencies

Declare node/npm dependencies
Add NOTES files about dependencies not updated by purpose (and why)
Update other dependencies
Hopefully fixes voidlabs#454

* Prepare for 0.17.4 release / downgrade csswring to 6.0.3 to keep node 6/7 compat

csswring 7.0.0 broke the build under older node versions.

* Fix lock file for downgraded csswring

* NODE – update version

* DEPENDENCIES – update patch/minor

* PRETTIER – add

* DEPENDENCIES – update and fix code

* DEPENDENCIES – add back mosaico's editor's one

* DEPENDENCIES – remove bower

* BUILD – can do again \O/

* DEPENDENCIES – update

* I18N – fix some

* DOWNLOAD – first step of making a download without the images

* ICONS – fix some

* DOWNLOAD – implement CDN images

* ICONS – fix more

* ICONS – fix some more

* DEPENDENCIES – update

* DEPENDENCIES – update font-awesome

* PREVIEW – begin to add on smaller devices

* PREVIEW – change icon when active

* BUILD – fix tinymce plugins

* PREVIEW – fix edit zone resizing on small device

* PREVIEW – highlight current item selected

* BUILD – forcing “npm install” should be obsolete: no more use of bower

* README – update

* RELEASE – keep bin folder

* HEROKU – revert back dependencies install for installing in heroku

* HEROKU – add back gulpfile for building

* HEROKU – add back src folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants