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

Example errors out with Typescript no output #158

Open
jschaf opened this issue Feb 27, 2016 · 4 comments
Open

Example errors out with Typescript no output #158

jschaf opened this issue Feb 27, 2016 · 4 comments

Comments

@jschaf
Copy link

jschaf commented Feb 27, 2016

I'm having a ton of trouble trying to get the example to run. I cloned the repository and ran npm install and tsd install. After running npm start, I get the following output:

C:\Users\joe\prog\react-typescript-boilerplate>npm start

> [email protected] start C:\Users\joe\prog\react-typescript-boilerplate
> node dev_server.js

Listening at http://localhost:3000
ts-loader: Using [email protected] and C:\Users\joe\prog\react-typescript-boilerplate\tsconfig.json
webpack built abbe0a7a735d670bb7c7 in 2155ms
Hash: abbe0a7a735d670bb7c7
Version: webpack 1.12.14
Time: 2155ms
 Asset     Size  Chunks       Chunk Names
app.js  32.4 kB       0       main
chunk    {0} app.js (main) 8.29 kB [rendered]
    [0] multi main 40 bytes {0} [built] [1 error]
    [1] (webpack)-hot-middleware/client.js 3.43 kB {0} [built]
    [2] (webpack)/buildin/module.js 251 bytes {0} [built]
    [3] ./~/strip-ansi/index.js 161 bytes {0} [built]
    [4] ./~/ansi-regex/index.js 135 bytes {0} [built]
    [5] (webpack)-hot-middleware/client-overlay.js 1.01 kB {0} [built]
    [6] (webpack)-hot-middleware/process-update.js 3.27 kB {0} [built]
ERROR in ./app/index.tsx
Module build failed: Error: Typescript emitted no output for C:\Users\joe\prog\react-typescript-boilerplate\app\index.tsx
    at Object.loader (C:\Users\joe\prog\react-typescript-boilerplate\node_modules\ts-loader\index.js:437:15)
 @ multi main

If I browse to localhost:3000, I get index.html but static/app.js seems has the same contents as index.html so Chrome fails to parse the the javascript file.

Did I miss a step?

@jschaf
Copy link
Author

jschaf commented Feb 27, 2016

If I remove the noEmit: true from tsconfig.json, the example works. Is noEmit supposed to be set to true? It looks like it gets loaded with webpack-dev-middleware.

@keokilee
Copy link
Owner

keokilee commented Mar 1, 2016

That's interesting. I think it's because of the new version of TS. Maybe the thing to do is to just remove that line from tsconfig.json.

@nunobaba
Copy link

nunobaba commented Mar 8, 2016

UPDATE: Somehow, by cleaning the output js file, the build went through. Take the following as if it was a bad dream.

While noEmit: true gets rid of the error for the dev server, the build couldn't still go through. The console output follows:

> NODE_ENV=production webpack --config config/webpack.prod.js --progress --display-error-details

10% 0/1 build modulests-loader: Using [email protected] and tsconfig.json
3260ms build modules      
7ms seal 
14ms optimize
10ms hashing
23ms create chunk assets
786ms additional chunk assets
470ms optimize chunk assets
662ms optimize assets
14ms emit
Hash: 8b07afa8903b37de50ac
Version: webpack 1.12.14
Time: 5310ms
Asset    Size  Chunks             Chunk Names
app.js  701 kB       0  [emitted]  main
app.js.map  834 kB       0  [emitted]  main
+ 177 hidden modules

ERROR in app.js from UglifyJs
Unexpected token: name (App) [./app/components/app.js:20,0]

The error reminds the one with the dev server.

@JoseFMP
Copy link

JoseFMP commented Dec 26, 2018

For me also happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants