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

Webpack issues: Module build failed: Error: Typescript emitted no output for ... #134

Closed
dessalines opened this issue Jan 10, 2017 · 11 comments
Labels

Comments

@dessalines
Copy link

I recently upgraded angular to 2.4.1, and angular2-notifications to 0.4.49, and now I'm getting the following errors when I run webpack:

    ERROR in ./~/angular2-notifications/src/push-notifications.service.ts
    Module build failed: Error: Typescript emitted no output for /home/asdf/git/asdf/node_modules/angular2-notifications/src/push-notifications.service.ts
        at Object.loader (/home/asdf/git/asdf/node_modules/ts-loader/index.js:437:15)
     @ ./~/angular2-notifications/components.js 14:35-78
    
    ERROR in ./~/angular2-notifications/src/notifications.service.ts
    Module build failed: Error: Typescript emitted no output for /home/asdf/git/asdf/node_modules/angular2-notifications/src/notifications.service.ts
        at Object.loader (/home/asdf/git/asdf/node_modules/ts-loader/index.js:437:15)
     @ ./~/angular2-notifications/components.js 8:30-68
    
    ERROR in ./~/angular2-notifications/src/max.pipe.ts
    Module build failed: Error: Typescript emitted no output for /home/asdf/git/asdf/node_modules/angular2-notifications/src/max.pipe.ts
        at Object.loader (/home/asdf/git/asdf/node_modules/ts-loader/index.js:437:15)
     @ ./~/angular2-notifications/components.js 10:17-42
    Warning: Task "webpack:dev" failed. Use --force to continue.
@flauc
Copy link
Owner

flauc commented Jan 10, 2017

Hmm, first time I see this. Thanks for reporting it. I'll look in to it. 👍

@flauc flauc added the bug label Jan 10, 2017
@dotixx
Copy link

dotixx commented Jan 25, 2017

@flauc Same issue here :s

@tscislo
Copy link

tscislo commented Feb 4, 2017

Same issue using Angular 2.4.0 with webpack 1.13.2 and TS 2.1.4

@totycro
Copy link

totycro commented Feb 24, 2017

I'd like to use angular2-notifications, but can't because of this bug.. do you have any idea when it can be fixed?

@rafaeltmc
Copy link

rafaeltmc commented Feb 24, 2017

similar here with angular 4.0.0-beta.8 and typescript 2.2.0

ERROR in angular2-notifications/src/push-notifications.service.ts
Module build failed: Error: Typescript emitted no output for ...\node_modules\angular2-notifications\src\push-notifications.service.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More microsoft/TypeScript#12358
at Object.loader (...\node_modules\ts-loader\dist\index.js:32:15)
@ angular2-notifications/components.js 14:35-78

@rmannibucau
Copy link

rmannibucau commented Mar 8, 2017

same there with angular 4 rc2 and webpack/typescript

edit: one workaround is to ensure js are loaded before ts so

extensions: ['.js', '.ts', ...],

and not

extensions: ['.ts', '.js', ...],

@juliusl
Copy link

juliusl commented Mar 30, 2017

@rmannibucau This fixed my issue for a completely different package. Why does that work?

@rmannibucau
Copy link

cause webpack will match the file resolution in this "order". The issue is the ts not being supported anymore (nothing to convert to js basically). Loading the js before you will get a version not going through the exact same validations and or based on a different model (depends a bit other parts of the build). Concretely in that case the "empty" ts file is not seen and the build sees an actual js file which doesnt break the validations rules.

@juliusl
Copy link

juliusl commented Mar 30, 2017

@rmannibucau Thanks for the explanation, it makes a lot more sense now.

@flauc
Copy link
Owner

flauc commented Apr 9, 2017

Hi everyone, think this has been resolved with the latest push, let me know if you are still getting it though.

@flauc flauc closed this as completed Apr 9, 2017
@edzillion
Copy link

edzillion commented Jun 26, 2017

This is still happening to me and was resolved by changing the order of extensions as suggested above:

File: node_modules\@ionic\app-scripts\config\webpack.config.js
15:   resolve: {
16:     extensions: ['.js', '.ts', '.json'],
17:     modules: [path.resolve('node_modules')]
18:   },

thanks! here's my setup FYI:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.8
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.4.2

System:

    Node       : v6.11.0
    OS         : Windows 8.1
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 4.1.2

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

9 participants