Experience-Monks / ae-to-json

will export an After Effects project as a JSON object
MIT License
237 stars 26 forks source link

Unexpected token error #14

Open ZachSaucier opened 8 years ago

ZachSaucier commented 8 years ago

I've installed ae-to-json and the other requirements and don't get any errors when I run node someFile.js with this inside it:

var aeToJSON = require('ae-to-json/after-effects');
var ae = require('after-effects');

However, if I add ae.execute(aeToJSON) afterwards, taken from the instructions, then I get this:

SyntaxError: unknown: Unexpected token (1:9)
> 1 | function () {
    |          ^
  2 | var window = {};
  3 | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.aeToJSON = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  4 | 'use strict';
    at Parser.pp.raise (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\location.js:22:13)
    at Parser.pp.unexpected (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\util.js:89:8)
    at Parser.pp.parseFunction (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\statement.js:639:10)
    at Parser.pp.parseFunctionStatement (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\statement.js:308:15)
    at Parser.pp.parseStatement (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\statement.js:97:19)
    at Parser.pp.parseBlockBody (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\statement.js:529:21)
    at Parser.pp.parseTopLevel (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\statement.js:36:8)
    at Parser.parse (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\parser\index.js:129:19)
    at parse (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\node_modules\babylon\lib\index.js:47:47)
    at File.parse (C:\Users\ste\Documents\WAR\node_modules\after-effects\node_modules\babel-core\lib\transformation\file\index.js:517:34)

It seems that the AE project is not being converted to JS properly and thus interprets it as this mess of symbols.

How can I fix this issue?

mikkoh commented 8 years ago

@ZachSaucier I'm currently at a conference and will try to look into this when I'm back. From the pathing I notice you're on Windows. I have not tested on windows yet. I will have to check if the issue is caused by this.