apla / atom-jscad

Previewing (J)SCAD 3D models inside Atom.
MIT License
29 stars 9 forks source link

Uncaught TypeError: Not a string or buffer #3

Closed Gasman2014 closed 7 years ago

Gasman2014 commented 8 years ago

[Enter steps to reproduce below:]

  1. ...New file in Atom
  2. ...cube([10,10,10]); Run atom-scad-preview get an error with crypto.js:70

Atom Version: 1.8.0 System: Mac OS X 10.11.5 Thrown From: atom-scad-preview package, v0.1.0

Stack Trace

Uncaught TypeError: Not a string or buffer

At crypto.js:70

TypeError: Not a string or buffer
    at TypeError (native)
    at Hash.update (crypto.js:70:16)
    at new AtomScadPreviewView (/Users/johnpateman/.atom/packages/atom-scad-preview/lib/atom-scad-preview-view.js:19:52)
    at /Users/johnpateman/.atom/packages/atom-scad-preview/lib/atom-scad-preview.js:55:14
    at Workspace.module.exports.Workspace.openURIInPane (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:489:22)
    at Workspace.module.exports.Workspace.open (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:424:19)
    at Object.module.exports.AtomScadPreview.toggle (/Users/johnpateman/.atom/packages/atom-scad-preview/lib/atom-scad-preview.js:86:22)
    at atom-workspace.subscriptions.add.atom.commands.add.atom-scad-preview:toggle (/Users/johnpateman/.atom/packages/atom-scad-preview/lib/atom-scad-preview.js:28:24)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1100:28)
    at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/application-delegate.js:327:25)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)

Commands

     -2:39.2.0 application:show-settings (a.inline-block)
     -1:32.6.0 grammar-selector:show (atom-text-editor.editor)
     -1:29.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -1:21.6.0 atom-scad-preview:toggle (a.inline-block)
     -0:18.5.0 application:new-file (atom-pane.pane.active)
     -0:15.5.0 core:paste (atom-text-editor.editor.is-focused)
     -0:12.2.0 grammar-selector:show (atom-text-editor.editor.is-focused)
     -0:09.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:01.8.0 atom-scad-preview:toggle (a.inline-block)

Config

{
  "core": {
    "disabledPackages": [
      "mcduino",
      "build-tools",
      "r-exec",
      "language-matlab-octave",
      "git-time-machine",
      "highlight-column",
      "imdone-atom",
      "g-code"
    ],
    "projectHome": "/Users/johnpateman/Documents/Code/",
    "themes": [
      "one-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
Repl, v0.5.0
atom-beautify, v0.29.8
atom-scad-preview, v0.1.0
auto-update-packages, v1.0.1
autocomplete-clang, v0.9.3
build, v0.64.0
build-make, v0.10.0
build-xcodebuild, v0.2.0
busy, v0.5.0
file-icons, v1.7.14
highlight-selected, v0.11.2
ink, v0.4.4
julia-client, v0.4.7
language-arduino, v0.4.1
language-gherkin, v1.0.4
language-ini, v1.16.0
language-julia, v0.6.0
language-linuxcnc-gcode, v0.1.0
language-mathematica, v0.2.0
language-openscad, v0.4.3
language-r, v0.4.1
latex-completions, v0.3.1
linter, v1.11.10
linter-gcc, v0.6.14
linter-lintr, v1.0.4
linter-matlab, v1.1.0
minimap, v4.24.6
platformio-ide, v1.2.2
platformio-ide-terminal, v2.0.10
project-manager, v2.9.7
tool-bar, v0.4.0
uber-juno, v0.1.1

# Dev
No dev packages
apla commented 8 years ago

Actually there is a two dialects of OpenJsCad. First one requires to use CSG primitives, like here and another dialect from http://openjscad.org with cube/cylinder/etc functions. Support for openjscad.org dialect was added in fbc6d165.

matiasinsaurralde commented 8 years ago

@Gasman2014 Actually the first version / previous version stopped working on the new Atom releases. So the @apla patch solved the problem, version 0.1.0 is just this patch and doesn't support the additional dialect. I will publish a new version now, with all the commits from @apla, they're merged and they do support this dialect.

Gasman2014 commented 8 years ago

Thank you - I like Atom for a lot of things so being able to do the odd bit of OpenSCAD would be really useful.

John

On 14 Jun 2016, at 20:51, Matias Insaurralde notifications@github.com wrote:

@Gasman2014 https://github.com/Gasman2014 Actually the first version / previous version stopped working on the new Atom releases. So the @apla https://github.com/apla patch solved the problem, version 0.1.0 is just this patch and doesn't support the additional dialect. I will publish a new version now, with all the commits from @apla https://github.com/apla, they're merged and they do support this dialect.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/matiasinsaurralde/atom-scad-preview/issues/3#issuecomment-225996133, or mute the thread https://github.com/notifications/unsubscribe/AIAyuY6VjYIQZMWfxv3G4J5MPPngSzqlks5qLwZXgaJpZM4I1rAx.

apla commented 8 years ago

@Gasman2014 any issues with a new version?

juliendorra commented 8 years ago

As far as I understand it, the issue is caused by non-saved new files. (and not by a dialect issue).

so the issue is: Atom-scad-preview is not able to preview a temp, never-saved file.

Once you save the file as .jscad or .js the preview then work without issue.

apla commented 7 years ago

Now if file is not saved, you'll see message about this when you launch renderer.