Search code examples
node.jsmediawikimediawiki-apimediawiki-extensions

Parsoid Server didn't parse pages


Hello:) Got some problems with install of VisualEditor. I have to install Parsoid server and run it. But when I trying to parse some page, I'm getting an error:

TypeError: Cannot read property 'length' of undefined
at peg$c379 (eval at <anonymous> (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:1356:61)
at peg$parseeof (eval at <anonymous> (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:14738:12)
at peg$parsetlb (eval at <anonymous> (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:2007:12)
at peg$parsetoplevelblock (eval at <anonymous> (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:1909:12)
at Object.parse (eval at <anonymous> (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:17872:18)
at PegTokenizer.tokenizeAsync (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:206:24)
at PegTokenizer._processText (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:180:8)
at PegTokenizer.process (/opt/bitnami/apps/parsoid/lib/mediawiki.tokenizer.peg.js:119:7)
at ParserPipeline.process (/opt/bitnami/apps/parsoid/lib/mediawiki.parser.js:485:21)
at Object.Util.processContentInPipeline (/opt/bitnami/apps/parsoid/lib/mediawiki.Util.js:1112:12)

This is not the same error like this, coz my express and connect versions look fine:

├── alea@0.0.9
├── async@0.9.0
├─┬ bunyan@1.0.1
│ └─┬ mv@2.0.3
│   ├─┬ mkdirp@0.5.0
│   │ └── minimist@0.0.8
│   ├── ncp@0.6.0
│   └── rimraf@2.2.8
├─┬ chai@1.9.2
│ ├── assertion-error@1.0.0
│ └─┬ deep-eql@0.1.3
│   └── type-detect@0.1.1
├── colors@0.6.2
├── diff@1.0.8
├── domino@1.0.18
├── entities@1.1.1
├── es6-shim@0.16.0
├─┬ express@2.5.11
│ ├─┬ connect@1.9.2
│ │ └── formidable@1.0.15
│ ├── mime@1.2.4
│ ├── mkdirp@0.3.0
│ └── qs@0.4.2
.......

I`ve got: NodeJS(v0.10.33), npm(2.1.5) on Ubuntu 14.04.1 LTS

Any ideas?:)

UPDATE:

I just noticed, that I can add new pages with VisualEditor and edit em, also i can edit already existing pages, but if there are no templates. If these pages have templates then there is an error previously described.


Solution

  • There was a problem with version (I got MW 1.23.6 (latest stable)).

    I have to update to MediaWiki 1.24 and reinstall VisualEditor (Parsoid already exists in MW >1.24) and then it works fine without errors. Upstart on Ubuntu working well too.