Unexpected value 'FileUploadModule' imported by the module 'UploaderModule' #426

Open
opened 2016-09-29 01:11:01 +00:00 by crowmagnumb · 4 comments
crowmagnumb commented 2016-09-29 01:11:01 +00:00 (Migrated from github.com)

Getting the above error after moving from RC4 to release. Here is link to my stackoverflow incident
Any ideas?

Getting the above error after moving from RC4 to release. [Here is link to my stackoverflow incident](http://stackoverflow.com/questions/39759764/unexpected-value-fileuploadmodule-imported-by-the-module-uploadermodule-ng) Any ideas?
crowmagnumb commented 2016-09-30 00:21:38 +00:00 (Migrated from github.com)

UPDATE: Inspired by this reverse issue I copied node_module/ng2-file-upload to the directory that this component is in and changed my import to be ...

import {FileUploadModule} from './ng2-file-upload/ng2-file-upload.js'

...and it worked! Is there a problem with the way you are exporting this module that it has to be relative?

UPDATE: Inspired by this [reverse issue](http://stackoverflow.com/questions/39759855/import-component-works-when-in-app-folder-but-not-when-installed-as-node-module) I copied node_module/ng2-file-upload to the directory that this component is in and changed my import to be ... `import {FileUploadModule} from './ng2-file-upload/ng2-file-upload.js'` ...and it worked! Is there a problem with the way you are exporting this module that it has to be relative?
crowmagnumb commented 2016-09-30 18:08:18 +00:00 (Migrated from github.com)

I tried importing it as a file rather than a module but leaving it in place, changed my import to this ...

import {FileUploadModule, FileUploader} from '../../../jspm_packages/npm/ng2-file-upload@1.1.0/ng2-file-upload';

...and I'm back to the error again.

I then symlinked in my project root as ng2-file-upload to ../../../jspm_packages/npm/ng2-file-upload@1.1.0/ng2-file-upload and changed my import to...

import {FileUploadModule, FileUploader} from '../../../ng2-file-upload/ng2-file-upload';

...and it worked fine!

So I think jspm/systemjs knows that the direct path is actually an npm package and must try to import it differently than straight up as a file. And as a file it loads the module correctly.

Just for the record, since I didn't specify above, I am using a pure js solution (yes, I am bucking the trend, but not a Typescript fan).

I tried importing it as a file rather than a module but leaving it in place, changed my import to this ... `import {FileUploadModule, FileUploader} from '../../../jspm_packages/npm/ng2-file-upload@1.1.0/ng2-file-upload';` ...and I'm back to the error again. I then symlinked in my project root as ng2-file-upload to **../../../jspm_packages/npm/ng2-file-upload@1.1.0/ng2-file-upload** and changed my import to... `import {FileUploadModule, FileUploader} from '../../../ng2-file-upload/ng2-file-upload';` ...and it worked fine! So I think jspm/systemjs knows that the direct path is actually an npm package and must try to import it differently than straight up as a file. And as a file it loads the module correctly. Just for the record, since I didn't specify above, I am using a pure js solution (yes, I am bucking the trend, but not a Typescript fan).
marclerman commented 2016-10-04 14:48:18 +00:00 (Migrated from github.com)

I am getting this error too when using ng-xi18n (Angular 2 final --this is the utility to perform internationalization). All Typescript here.

I am getting this error too when using ng-xi18n (Angular 2 final --this is the utility to perform internationalization). All Typescript here.
dave9111964 commented 2016-11-03 14:48:44 +00:00 (Migrated from github.com)

I changed
import { FileUploadModule, FileUploader } from 'ng2-file-upload/ng2-file-upload';
to
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
and the error went away. I guess the docs need to be updated.

I changed import { FileUploadModule, FileUploader } from 'ng2-file-upload/ng2-file-upload'; to import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; and the error went away. I guess the docs need to be updated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#426