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

Parse error when building #49

Closed
yuyinitos opened this issue May 6, 2016 · 10 comments
Closed

Parse error when building #49

yuyinitos opened this issue May 6, 2016 · 10 comments
Labels

Comments

@yuyinitos
Copy link

After modifying the gulp file with:

`gulp.task('watch', ['clean'], function(done){
runSequence(
['sass', 'html', 'fonts', 'scripts'],
function(){
gulpWatch('app//*.scss', function(){ gulp.start('sass'); });
gulpWatch('app/
/*.html', function(){ gulp.start('html'); });
buildBrowserify({
watch: true,
src: ['./app/app.js', './node_modules/ionic-audio/dist/ionic-audio.ts', './node_modules/ionic-audio/typings/main.d.ts']
}).on('end', done);
}
);
});

gulp.task('build', ['clean'], function(done){
runSequence(
['sass', 'html', 'fonts', 'scripts'],
function(){
buildBrowserify({
minify: isRelease,
browserifyOptions: {
debug: !isRelease
},
uglifyOptions: {
mangle: false
},
src: ['./app/app.js', './node_modules/ionic-audio/dist/ionic-audio.ts', './node_modules/ionic-audio/typings/main.d.ts']
}).on('end', done);
}
);
});
`

I'm getting this parse error:

...node_modules/ionic-audio/dist/ionic-audio.ts:8 export * from './ionic-audio-interfaces'; ^ ParseError: 'import' and 'export' may appear only with 'sourceType: module'

@arielfaur
Copy link
Owner

Are you trying the builtin project? Or is it a new project started from scratch?

@yuyinitos
Copy link
Author

I started a new v2 project from scratch using .js files.

@arielfaur
Copy link
Owner

Could you please copy the demo folder that ships with the module as is and try to build it? Let's see if the same error is thrown.
On the other hand, you created an ES6 project with Ionic right? (you didn't use the --ts flag)

@yuyinitos
Copy link
Author

I didn't use the --ts flag to create my project. I'm not sure if I can use both .js and .ts files in my project?

When I try to build the demo app I run into:

∆ Installing ios for you.
√ Installed platform ios
Installing cordova-plugin-device
Installing cordova-plugin-console
Installing cordova-plugin-whitelist
Installing cordova-plugin-splashscreen
Installing cordova-plugin-statusbar
Installing ionic-plugin-keyboard
Running command: /Users/Eugene/Code/demo/hooks/after_prepare/010_add_platform_class.js /Users/Eugene/Code/demo
Error: spawn EACCES

@arielfaur
Copy link
Owner

Basic questions: you did run npm install prior to building right? Are the hook files available within hooks folder?

@yuyinitos
Copy link
Author

Sorry, it's getting late over here ;) I ran npm install. Then ionic build and these erros appear.

TypeScript error: /Users/Eugene/Code/demo/app/pages/page1/page1.ts(10,14): Error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
TypeScript error: /Users/Eugene/Code/demo/app/pages/page2/page2.ts(9,14): Error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
TypeScript error: /Users/Eugene/Code/demo/app/pages/page3/page3.ts(9,14): Error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
TypeScript error: /Users/Eugene/Code/demo/app/pages/tabs/tabs.ts(10,14): Error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
TypeScript error: /Users/Eugene/Code/demo/node_modules/ionic-audio/dist/ionic-audio-cordova-track.ts(15,14): Error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
TypeScript error: /Users/Eugene/Code/demo/node_modules/ionic-audio/dist/ionic-audio-cordova-track.ts(95,14): Error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
etc., etc.

@arielfaur
Copy link
Owner

arielfaur commented May 6, 2016

OK, i think there are a lot of errors somehow related to the environment. I've never seen these before.
One thing you could try is start a fresh ionic 2 typescript project from scratch (using both --v2 and --ts flags). That way we're certain the environment is correct, install ionic-audio with npm, and then either copy the source files from demo into the new project folder, or create new pages yourself.

@yuyinitos
Copy link
Author

I started a new v2 typescript project and added ionic-audio to it and it works fine! Thanks a lot for your help!

@arielfaur
Copy link
Owner

Ok, good to hear So it seems then that using the --ts flag is compulsory

@yuyinitos
Copy link
Author

Yes it seems like it.

@arielfaur arielfaur added the v2 label May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants