bleenco / ngx-uploader

Angular File Uploader
https://ngx-uploader.jankuri.me
MIT License
757 stars 348 forks source link

Problem with running app on a Mac #204

Closed maartentibau closed 7 years ago

maartentibau commented 7 years ago

Hi,

I'm work on a PC, Windows 8.1, my colleague works on a Mac, latest Mac OSX version. But when he runs the project, he gets theses errors:

ERROR in ./~/ngx-uploader/src/directives/ng-file-drop.ts
Module parse failed: /Applications/MAMP/htdocs/myproject/node_modules/ngx-uploader/src/directives/ng-file-drop.ts Unexpected character '@' (16:0)
You may need an appropriate loader to handle this file type.
| import { NgUploaderOptions, UploadedFile, UploadRejected } from '../classes/index';
| 
| @Directive({
|   selector: '[ngFileDrop]'
| })
 @ ./~/ngx-uploader/index.js 5:21-61 7:9-49
 @ ./src/app/modules/shared/shared.module.ts
 @ ./src/app/modules/auth/auth.module.ts
 @ ./src/app/app.routing.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi app

ERROR in ./~/ngx-uploader/src/directives/ng-file-select.ts
Module parse failed: /Applications/MAMP/htdocs/myproject/node_modules/ngx-uploader/src/directives/ng-file-select.ts Unexpected character '@' (15:0)
You may need an appropriate loader to handle this file type.
| import { NgUploaderOptions, UploadedFile, UploadRejected } from '../classes/index';
| 
| @Directive({
|   selector: '[ngFileSelect]',
|   providers: [
 @ ./~/ngx-uploader/index.js 6:23-65 8:9-51
 @ ./src/app/modules/shared/shared.module.ts
 @ ./src/app/modules/auth/auth.module.ts
 @ ./src/app/app.routing.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi app

ERROR in ./~/ngx-uploader/src/services/ngx-uploader.ts
Module parse failed: /Applications/MAMP/htdocs/myproject/node_modules/ngx-uploader/src/services/ngx-uploader.ts Unexpected character '@' (5:0)
You may need an appropriate loader to handle this file type.
| import { UploadedFile } from '../classes/uploaded-file.class';
| 
| @Injectable()
| export class NgUploaderService {
|   _queue: any[];
 @ ./~/ngx-uploader/index.js 9:9-47
 @ ./src/app/modules/shared/shared.module.ts
 @ ./src/app/modules/auth/auth.module.ts
 @ ./src/app/app.routing.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi app

....

Any idea how this would be solvable?

jkuri commented 7 years ago

please see https://github.com/jkuri/ng2-datepicker/issues/136#issuecomment-269690127, looks like same error.

maartentibau commented 7 years ago

Thx for the fast response man!

This fixed it for me. Just added ngx-.+

module: {
  loaders: [
    // Typescript loader
    {
      test: /\.ts$/,
      loaders: ['awesome-typescript-loader', 'angular2-template-loader']
      exclude: [/node_modules\/(?!(ng2-.+|ngx-.+))/]
     },

     ....