y-takey / atom-mermaid

Preview mermaid on atom editor
MIT License
42 stars 7 forks source link

Failed to activate the atom-mermaid package #10

Closed echoma closed 8 years ago

echoma commented 8 years ago

[Enter steps to reproduce below:]

  1. open a markdown document which includes mermaid diagrams
  2. select "Toggle Preview" in the menu bar

Atom Version: 1.0.19 System: Ubuntu 15.04 Thrown From: atom-mermaid package, v0.1.3

Stack Trace

Failed to activate the atom-mermaid package

At Module did not self-register.

Error: Module did not self-register.
  at Error (native)
  at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:137:20)
  at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:137:20)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at bindings (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:76:44)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/node_modules/contextify/lib/contextify.js:1:96)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/lib/jsdom/browser/index.js:14:21)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/lib/jsdom.js:11:20)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/index.js:1:78)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/mermaid-view.coffee:6:25)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/mermaid-view.coffee:1:1)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .coffee] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/atom-mermaid.coffee:2:35)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/atom-mermaid.coffee:1:1)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .coffee] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Package.module.exports.Package.requireMainModule (/usr/share/atom/resources/app.asar/src/package.js:761:34)
  at Package.module.exports.Package.activateConfig (/usr/share/atom/resources/app.asar/src/package.js:263:14)
  at Package.module.exports.Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:241:14)
  at /usr/share/atom/resources/app.asar/src/package.js:838:25
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:226:20)
  at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app.asar/src/command-registry.js:145:19)
  at EventEmitter.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:70:30)
  at emitOne (events.js:77:13)
  at EventEmitter.emit (events.js:169:7)

Commands

     -0:00.9.0 atom-mermaid:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "packagesWithKeymapsDisabled": [
      "autocomplete-plus"
    ]
  }
}

Installed Packages

# User
atom-mermaid, v0.1.3

# Dev
No dev packages
y-takey commented 8 years ago

Hi @echoma,

Thanks for report. I am aware about the problem to install ubuntu. (same issue: https://github.com/y-takey/atom-mermaid/issues/9 ) Sorry, It seems to be a general problem, but have not yet resolved.

What's your node version? If your node is older, please try to upgrade. Then please run cd ~/.atom/packages/atom-mermaid; apm rebuild . (Please replace the path of your environment)

echoma commented 8 years ago

yes, the nodejs in ubuntu15.04 is v0.10.25 which is too old. I upgraded nodejs to the lastest v4.2.1, make sure /usr/bin/node and /usr/bin/nodejs are both the latest version. and then do the "apm rebuild" as you said. But still got the same error.

y-takey commented 8 years ago

Thanks for the doing. and Sorry, it seem to be not compatible with the latest nodejs. If you can easily, please try using the nodev0.12.

I hope to be successful.

echoma commented 8 years ago

I switched to node v0.12.7, still got problem, but shows different stack trace:

Failed to activate the atom-mermaid package
Module did not self-register.
Hide Stack Trace
Error: Module did not self-register.
  at Error (native)
  at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:137:20)
  at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:137:20)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at bindings (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:76:44)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/node_modules/contextify/lib/contextify.js:1:96)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/lib/jsdom/browser/index.js:14:21)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/node_modules/jsdom/lib/jsdom.js:11:20)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/node_modules/d3/index.js:1:78)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/mermaid-view.coffee:6:25)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/mermaid-view.coffee:1:1)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .coffee] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/atom-mermaid.coffee:2:35)
  at Object.<anonymous> (/home/echo/.atom/packages/atom-mermaid/lib/atom-mermaid.coffee:1:1)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .coffee] (/usr/share/atom/resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Package.module.exports.Package.requireMainModule (/usr/share/atom/resources/app.asar/src/package.js:761:34)
  at Package.module.exports.Package.activateConfig (/usr/share/atom/resources/app.asar/src/package.js:263:14)
  at Package.module.exports.Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:241:14)
  at /usr/share/atom/resources/app.asar/src/package.js:838:25
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:226:20)
  at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app.asar/src/command-registry.js:145:19)
  at [object Object].jQuery.fn.trigger (/usr/share/atom/resources/app.asar/src/space-pen-extensions.js:64:23)
  at EventEmitter.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:75:67)
  at emitTwo (events.js:87:13)
  at EventEmitter.emit (events.js:172:7)
  at EventEmitter.ipc.sendSync (/usr/share/atom/resources/atom.asar/renderer/api/lib/ipc.js:21:31)
  at BrowserWindow.RemoteMemberFunction [as emit] (/usr/share/atom/resources/atom.asar/renderer/api/lib/remote.js:140:29)
  at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/usr/share/atom/resources/app.asar/src/context-menu-manager.js:170:31)
  at HTMLDocument.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:157:33)
  at HTMLDocument.handler (/usr/share/atom/resources/app.asar/src/space-pen-extensions.js:112:34)
  at HTMLDocument.jQuery.event.dispatch (/usr/share/atom/resources/app.asar/node_modules/space-pen/vendor/jquery.js:4681:9)
  at HTMLDocument.elemData.handle (/usr/share/atom/resources/app.asar/node_modules/space-pen/vendor/jquery.js:4359:46)
y-takey commented 8 years ago

Thanks to try! It seems the same content in the format is different only, because nodejs version is deffrent. Try to find out so far cause is not known.

deftdawg commented 8 years ago

Got an error on OSX trying to activate preview as well.

[Enter steps to reproduce below:]

  1. open a markdown document which includes mermaid diagrams
  2. select "Toggle Preview" in the menu bar

Atom Version: 1.0.19 System: Mac OS X 10.11 Thrown From: atom-mermaid package, v0.1.3

Stack Trace

Failed to activate the atom-mermaid package

At /Users/ged/.atom/packages/atom-mermaid/node_modules/mermaid/src/mermaid.js:19
import * as Logger from './logger';
^^^^^^
Unexpected reserved word

/Users/ged/.atom/packages/atom-mermaid/node_modules/mermaid/src/mermaid.js:19
import * as Logger from './logger';
^^^^^^
SyntaxError: Unexpected reserved word
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:411:25)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
    at Module.load (module.js:353:32)
    at Function.Module._load (module.js:308:12)
    at Module.require (module.js:363:17)
    at require (module.js:382:17)
    at Object.<anonymous> (/Users/ged/.atom/packages/atom-mermaid/lib/mermaid-view.coffee:8:16)
    at Object.<anonymous> (/Users/ged/.atom/packages/atom-mermaid/lib/mermaid-view.coffee:1:1)
    at Module._compile (module.js:428:26)

Commands

     -0:02.5.0 atom-mermaid:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "metrics",
      "debugger",
      "debugger",
      "debugger",
      "markdown-preview"
    ],
    "useReactEditor": true
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.3.0
atom-html-preview, v0.1.11
atom-mermaid, v0.1.3
autoclose-html, v0.19.0
color-picker, v2.0.13
file-icons, v1.6.11
language-apache, v1.3.0
language-diff, v0.3.1
language-dot, v1.6.0
language-vbscript, v0.6.1
markdown-preview-plus, v2.2.2
markdown-table-formatter, v2.5.4
minimap, v4.15.0
pdf-view, v0.34.0
php-debug, v0.1.3
sequence-preview, v0.1.11

# Dev
No dev packages
y-takey commented 8 years ago

@echoma @jumpkick , Sorry the delay.

I updated and publish atom-mermaid package(version 0.2.0). Please update your package and try it with newer nodejs(v4.2.1) . I hope to be successful.

deftdawg commented 8 years ago

Worked after updating to 0.2.0. Thanks.

echoma commented 8 years ago

v0.2.0 wokrs great, thank you very much.

y-takey commented 8 years ago

Thank you very much. closed #10

monice commented 5 years ago

Got an error on windows trying to activate preview as well.

[Enter steps to reproduce below:]

open a markdown document which includes mermaid diagrams select "Toggle Preview" in the menu bar Atom Version: 1.40.1 x64 System: win10 x64 Thrown From: atom-mermaid package, v3.3.2

C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\dagre-d3-renderer\lib\label\add-html-label.js:1 (function (exports, require, module, filename, dirname, process, global, Buffer) { return function (exports, require, module, filename, dirname) { import util from '../util' ^^^^ SyntaxError: Unexpected identifier at new Script (vm.js:74:7) at NativeCompileCache.runInThisContext (C:\Users\xxxx\AppData\Local\atom\app-1.40.1\resources\app\static\:11:146322) at Module.get_Module._compile (C:\Users\xxxx\AppData\Local\atom\app-1.40.1\resources\app\static\:11:147206) at Object.value [as .js] (C:\Users\xxxx\AppData\Local\atom\app-1.40.1\resources\app\static\:11:150977) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:559:12) at Function.Module._load (internal/modules/cjs/loader.js:551:3) at Module.require (file:///C:/Users/xxxx/AppData/Local/atom/app-1.40.1/resources/app.asar/static/index.js:72:46) at require (C:\Users\xxxx\AppData\Local\atom\app-1.40.1\resources\app\static\:11:146745) at Object.dagre-d3-renderer/lib/label/add-html-label.js (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:16258:18) at webpack_require (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:30:30) at Module../src/diagrams/flowchart/flowRenderer.js (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:2926:103) at webpack_require (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:30:30) at Module../src/mermaidAPI.js (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:15421:90) at webpack_require (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:30:30) at Module../src/mermaid.js (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:15224:69) at webpack_require (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:30:30) at C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:94:18 at C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:97:10 at webpackUniversalModuleDefinition (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:3:20) at Object. (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:10:3) at Object. (C:\Users\xxxx.atom\packages\atom-mermaid\node_modules\mermaid\dist\mermaid.core.js:16331:3) at Module.get_Module._compile (C:\Users\xxxx\AppData\Local\atom\app-1.40.1\resources\app\static\:11:147429) at Object.value [as .js] (C:\Users\xxxx\AppData\Local\atom\app-1.40.1\resources\app\static\:11:150977) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:559:12) at Function.Module._load (internal/modules/cjs/loader.js:551:3) at Module.require (file:///C:/Users/xxxx/AppData/Local/atom/app-1.40.1/resources/app.asar/static/index.js:72:46) at require (C:\Users\xxxx\AppData\Local\atom\app-1.40.1\resources\app\static\:11:146745) at Object. (file:///C:/Users/xxxx/.atom/packages/atom-mermaid/lib/mermaid-view.coffee:9:11)