question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

building server in universal story - Error: Can't resolve 'ts-loader'

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.4.5 node: 8.6.0 os: linux x64 @angular/animations: 4.4.4 @angular/common: 4.4.4 @angular/compiler: 4.4.4 @angular/core: 4.4.4 @angular/forms: 4.4.4 @angular/http: 4.4.4 @angular/platform-browser: 4.4.4 @angular/platform-browser-dynamic: 4.4.4 @angular/platform-server: 4.4.4 @angular/router: 4.4.4 @angular/cli: 1.4.5 @angular/compiler-cli: 4.4.4 @angular/language-service: 4.4.4 typescript: 2.3.4

Repro steps.

  1. Follow the universal story to setup existing angular-cli project to universal.
  2. Run the command to build the universal server. webpack --config webpack.server.config.js --progress --colors

The log given by the failure.

webpack --config webpack.server.config.js --progress --colors

Hash: eb41d9b8aea4d4f2ca58
Version: webpack 3.6.0 Time: 32ms

ERROR in Entry module not found: Error: Can’t resolve ‘ts-loader’ in <some project> npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! poc@0.0.0 webpack:server: webpack --config webpack.server.config.js --progress --colors npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the poc@0.0.0 webpack:server script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/eyal/.npm/_logs/2017-10-11T05_21_36_973Z-debug.log eyal@eyal-ThinkPad-X270:~/poc$ npm i ts-loader npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

  • ts-loader@2.3.7 added 115 packages in 6.207s

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
elpdrccommented, Oct 11, 2017

I have solved this by doing npm i ts-loader. Just wanted to know if this is the right course of action and/or something in the universal doc is missing.

1reaction
MarkPieszakcommented, Oct 11, 2017

@elpdrc @hiepxanh via #8012 Thanks for pointing this one out, I must of overlooked it! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Can't resolve 'ts-loader'
tsx'] }, plugins: plugins }; module.exports = config;. Its a typescript project. When I run build and minify the typescript project using ...
Read more >
ts-loader - npm
Code Splitting and Loading Other Resources; Declarations (.d.ts); Failing the build on TypeScript compilation error; baseUrl / paths module ...
Read more >
How to Enable Server-Side Rendering for a React App
js offers a modern approach to creating static and server-rendered applications built with React. Introduction. Server-side rendering (SSR) is a ...
Read more >
webpack resolve alias not working - Feudo 43
isMultipleCompiler is not a function 64cb3d8 Building the app for development ... 8. scss'. js本机模块- Webpack 2: can't resolve node. js file and...
Read more >
TypeStrong/ts-loader - module - Gitter
Here is my tsconfig, which is the exact same as the server tsconfig: ... The error in question is Module not found: Error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found