Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running migrator #68

Open
lifeinafolder opened this issue May 14, 2015 · 7 comments
Open

Error running migrator #68

lifeinafolder opened this issue May 14, 2015 · 7 comments

Comments

@lifeinafolder
Copy link

I tried to migrate an ember app but ran into the following issue:

Preprocessing files
Failed to parse app.js
Note that you probably don't want to run the migrator against your npm or bower dependencies. Make sure that the directory you've specified in the '--source' flag only contains your application code.
Error: Line 12: Unexpected token ILLEGAL
/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:189
  var astBody = ast.program.body;
                   ^
TypeError: Cannot read property 'program' of undefined
    at EmberMigrator.splitFile (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:189:20)
    at Array.forEach (native)
    at EmberMigrator_run [as run] (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:82:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/ember-cli-migrator/bin/ember-cli-migrator:30:10)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)

I am using Ember-Rails gem. Any help would be appreciated.

@igorT
Copy link
Collaborator

igorT commented May 14, 2015

How does your app.js look like?

@lifeinafolder
Copy link
Author

Test = Ember.Namespace.create();

Test.App = Ember.Application.create({
  data: [], // some static data as placeholder for a BE response
  ready: function () {
    console.log('Ember Application Ready');
  }
});

@igorT
Copy link
Collaborator

igorT commented May 15, 2015

I am not sure we support custom namespaces, maybe @fivetanley or @tonysherbondy know

@Mitchal
Copy link

Mitchal commented Mar 12, 2017

I experience the same issue. Is there any solution?

@hefox
Copy link

hefox commented Nov 28, 2017

This error happens when recast is unable to parse a file, e.g. the Error: Line 12: Unexpected token ILLEGAL is it's parse error for app.js

However, it's not returning after catching the error which means it's goes to the next step with an invalid object, added a PR #83 to fix the error handling.

igorT added a commit that referenced this issue Nov 28, 2017
Modify error handling to address errors seen in #68
@igorT
Copy link
Collaborator

igorT commented Nov 28, 2017

Thanks a bunch for the fix.
I merged the PR

hefox pushed a commit to hefox/ember-cli-migrator that referenced this issue Dec 6, 2017
@hefox hefox mentioned this issue Dec 6, 2017
@hefox
Copy link

hefox commented Dec 6, 2017

#84 so far this appears to fix the errors I saw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants