Closed steinarb closed 4 years ago
There was probably a breaking change in js2-node
somewhere. I'm on 20190229 so somewhere between those two it broke.
I got the same error in an attempted rebuild from the tag 20190229 in the repo https://github.com/mooz/js2-mode (not sure if it is the right repo, but it was the one that came up first in google).
Here is what I did:
cd ~/git/
git clone https://github.com/mooz/js2-mode.git
cd ~/git/js2-mode/
git checkout -b release/20190219 20190219
mkdir -p /tmp/js2-mode-20190219
cp ~/git/js2-mode/*.el /tmp/js2-mode-20190219/
(define-package
"js2-mode"
"20190219"
"Improved JavaScript editing mode for GNU Emacs")
cd /tmp/
tar cvf js2-mode-20190219.tar js2-mode-20190219/
According to locate-library, js2-mode is fetched from the new package:
Library is file ~/.emacs.d/elpa/js2-mode-20190219/js2-mode.elc
(But as I said I don't know the relationship between the tag 20190219 and the 20190229 melpa package)
I tried getting some info on this problem, but so far without any success:
(setq debug-on-error t)
in .emacs to get a stack trace from the error.The menu-bar-update-hook only contains (menu-bar-update-buffers)
menu-bar-update-hook is a variable defined in ‘C source code’.
Its value is (menu-bar-update-buffers)
This variable may be risky if used as a file-local variable.
Documentation:
Normal hook run to update the menu bar definitions.
Redisplay runs this hook before it redisplays the menu bar.
This is used to update menus such as Buffers, whose contents depend on
various data.
One more datapoint: the problem only occurs in a .js or .jsx file that actually uses jsx syntax.
Files with only javascript get no error message and syntax highlighting. Removing all HTML-ish tags from a component definition causes the file to be syntax highlighted.
What I did was replacing the emacs 24 that was native of ubuntu 16.04 with emacs 26 for ubuntu.
Then I tried to let package-list-pacakages updated all of the packages it wanted to upgrade and remove all of the packages it wanted to delete. And at the end of that I ended up in the state that caused me to create this issue.
What I did to fix this/workaround the issue was to delete the ~/emacs.d/elpa/ directory and then start from scratch installing the packages I needed, from stable sources (gnu and melpa stable) if possible.
I ended up with v0.4.0 (not sure from where, I thought it was melpa stable, but melpa stable now has 20190614.2215) and now it works.
I guess this can be written down as a user error, and the lesson is: don't keep the ~/.emacs.d/elpa/ directory when bumping emacs two major versions.
I installed the newest rjsx-mode from melpa 20190614.2215 in emacs 26.1 on ubuntu 16.04.
However, no syntax highlighting happens and the following is written to the minibuffer
The js2-mode installed is also from melpa and is 20190815.1327.
Is the version of js2-mode the problem? Which version should I use?