postleaf icon indicating copy to clipboard operation
postleaf copied to clipboard

jQuery error when trying to edit a post

Open emmastone9 opened this issue 7 years ago • 5 comments

Summary

Write a post, save it and then go to admin/posts, try to click on any post, nothing happens. The following error gets displayed in developer console.

lib.bundle.js:120 Uncaught TypeError: $(...).selectable is not a function at HTMLDocument. (lib.bundle.js:120) at f (lib.bundle.js:80) at d (lib.bundle.js:80)

Additional info

  • Postleaf version: using master
  • Node version: 0.7
  • Affected browsers: chrome
  • Operating system: mac os.

emmastone9 avatar Feb 03 '18 23:02 emmastone9

What steps have you taken to build Postleaf?

claviska avatar Feb 04 '18 02:02 claviska

Here are the steps: git clone https://github.com/Postleaf/postleaf.git git clone https://github.com/Postleaf/empower-theme.git themes/empower-theme

Copied .env.example to .env and added localhost

vim package.json edited and saved as per https://github.com/Postleaf/postleaf/issues/78#issuecomment-361139100

npm install sudo npm install -g gulp-cli gulp build

node app.js

The app launches fine and I am able to make a post, however, start getting jQuery errors on other interactions as mentioned above.

emmastone9 avatar Feb 04 '18 05:02 emmastone9

Here's a fix tha worked for us, YMMV..

gulp build

The above command ends up updating assets/js/lib.bundle.js leading to jQuery errors. after the build is complete, just run the following command:

curl https://raw.githubusercontent.com/Postleaf/postleaf/master/assets/js/lib.bundle.js > assets/js/lib.bundle.js

i.e. overwrite the lib.bundle.js from the master, this fixed the above problem.

@claviska probably has a much cleaner way :-) , until then, the above fix should work.

emmastone9 avatar Feb 04 '18 20:02 emmastone9

I have a feeling this has something to do with the latest update to the selectable plugin. You could try forcing the previous release in package.json. Not positive until I have time to test this out though.

claviska avatar Feb 05 '18 04:02 claviska

Pinning claviska/jquery-selectable to 1.0.6 seems to fix the issue.

A7pr4Z avatar Aug 20 '18 13:08 A7pr4Z