-
Notifications
You must be signed in to change notification settings - Fork 13
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
script could not be parsed #49
Comments
Hi Jordan! The tool currently generates typescript files by default, and you need to run the file the way that it's described in the contentful-migration readme here: https://github.com/contentful/contentful-migration#writing-migrations-in-typescript One thing that's been on the wish list for a while is a command line flag that would have the tool generate javascript files instead of typescript files. If you'd like to submit a PR for that we'd merge it! |
Thanks for that! I'm still getting the same error though: I believe it fails on the first line, |
Usually when I get that error, it's due to Typescript targeting a version of JavaScript (aka ECMAScript aka ES) that the NodeJS runtime doesn't support. If your Typescript |
Thank you! I was using global ts-node, I had to either use node_modules/.bin/ts-node or specify --project tsconfig.json for it to work. |
Hello,
Thanks for creating this script!
I'm trying to call runMigration() on the generated ts file from the script, and it says "The 20200125001610_generated_diff_event.ts script could not be parsed, as it seems to contain syntax errors."
I also tried via contentful space migration, and I'm getting the same error with more detail:
I tried creating a similar tsconfig.json as in the project, and running
ts-node --project tsconfig.json migrateEvents.ts
, but it still gives the same error.The text was updated successfully, but these errors were encountered: