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

Im making a starter angular 4 project and it's getting me a warning #6870

Closed
segux opened this issue Jul 3, 2017 · 6 comments
Closed

Im making a starter angular 4 project and it's getting me a warning #6870

segux opened this issue Jul 3, 2017 · 6 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient

Comments

@segux
Copy link

segux commented Jul 3, 2017

[BUG] Im making a starter angular 4 project and it's getting me a warning

Versions.

@angular/cli: 1.1.3 (e)
node: 6.9.4
os: win32 x64
@angular/animations: 4.2.5
@angular/common: 4.2.5
@angular/compiler: 4.2.5
@angular/core: 4.2.5
@angular/forms: 4.2.5
@angular/http: 4.2.5
@angular/platform-browser: 4.2.5
@angular/platform-browser-dynamic: 4.2.5
@angular/router: 4.2.5
@angular/cli: 1.1.3
@angular/compiler-cli: 4.2.5
@angular/language-service: 4.2.5
@ngtools/webpack: 1.5.0

Repro steps.

  1. I make a clean new project with angular-cli running ng new "project"
  2. I run ng-eject to convert project into webpack
  3. I make another npm install for new dependencies
  4. I run npm run start

The log given by the failure.

WARNING in ./~/@angular/compiler/@angular/compiler.es5.js
(Emitted value instead of an instance of Error) Cannot find source file 'compiler.es5.ts': Error: Can't resolve './compiler.es5.ts' in 'C:\Users\jose.segura\WebstormProjects\untitled\testt\node_modules\@angular\compiler
\@angular'
 @ ./~/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js 7:0-72
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts

Desired functionality.

The project runs normally but i dont know if this warning will throw errors in the future

@segux segux changed the title WARNING in @angular/compiler.es5.js Cannot find source file 'compiler.es5.ts' Im making a starter angular 4 project and it's getting me a warning Jul 3, 2017
@Brocco Brocco added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient labels Jul 17, 2017
@christianscharr
Copy link
Contributor

christianscharr commented Jul 26, 2017

#7115 seems to be related to this

It seems to be related to the "source-map-loader" where the exclude-statement via regex doesnt work properly...
You can fix this by manually by editing the ejected webpack.config.json

"module": {
    "rules": [
      {
        "enforce": "pre",
        "test": /\.js$/,
        "loader": "source-map-loader",
        "exclude": [
          // instead of /\/node_modules\//
          path.join(process.cwd(), 'node_modules')
        ]
      },

Can you confirm this solves your problem? Will prepare an pull-request for this then...

@segux
Copy link
Author

segux commented Jul 26, 2017

@christianscharr Works like a charm. Solved the warning. Thanks!

@joansentis
Copy link

Hi,

I have the same issue in this versions:

"dependencies": {
"@angular/animations": "4.3.0",
"@angular/cli": "1.2.3",
"@angular/common": "4.3.0",
"@angular/compiler": "4.3.0",
"@angular/core": "4.3.0",
"@angular/forms": "4.3.0",
"@angular/http": "4.3.0",
"@angular/platform-browser": "4.3.0",
"@angular/platform-browser-dynamic": "4.3.0",
"@angular/material": "2.0.0-beta.6",
"@angular/platform-server": "4.3.0",
"@angular/router": "4.3.0",
"angular2-masonry": "0.4.0",
"awesome-typescript-loader": "2.2.1",
"core-js": "2.4.1",
"express": "4.15.3",
"hammerjs": "2.0.8",
"marked": "0.3.6",
"ng2-translate": "5.0.0",
"rxjs": "5.4.1",
"ts-helpers": "1.1.1",
"zone.js": "0.8.14"
},
"devDependencies": {
"@types/lodash": "4.14.58",
"lodash": "4.17.4",
"@angular/compiler-cli": "4.3.0",
"@angular/language-service": "4.3.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/marked": "0.0.28",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "4.4.0",
"protractor": "~5.1.2",
"raw-loader": "0.5.1",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3",
"typings": "2.1.1"
}

How can I fix it?

Thanks.

@btgoodwin
Copy link

I'm having the same problem with a project created with angular-cli v1.4.7. I ran ng eject and made the modification suggested by @christianscharr, but I still end up with these same warnings. Any word when a fix will make it to the baseline (I see the mention of v1.3.0 there, but I'm using 1.4.7 and it still has the previous style node_modules exclusion).

dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 2018
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 2018
@sajithgh
Copy link

sajithgh commented Nov 1, 2018

@christianscharr Works like a charm. Solved the warning. Thanks!

Could you please explain how did you fix this issue. I am facing the same issue. Exactly where do we need to copy this code

"module": {
"rules": [
{
"enforce": "pre",
"test": /.js$/,
"loader": "source-map-loader",
"exclude": [
// instead of //node_modules//
path.join(process.cwd(), 'node_modules')
]
},

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient
Projects
None yet
Development

No branches or pull requests

7 participants