Closed luckynick closed 4 years ago
Hi @luckynick, these errors/warnings are all genuine.
You are most likely including the CVS
directory as part of the compilation.
I am also seeing a lot of errors which are not caused by the CVS
, but either setup related or code related errors.
Example:
WARNING in ./src/app/model/season.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: C:\Users\Mykyta\Workspaces\Angular IDE\WebShopClientSSR\src\app\model\season.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (C:\Users\Mykyta\Workspaces\Angular IDE\WebShopClientSSR\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:933:23)
at plugin.done.then (C:\Users\Mykyta\Workspaces\Angular IDE\WebShopClientSSR\node_modules\@ngtools\webpack\src\loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
and
WARNING in ./src/app/app.component.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
β·
9 β $primary-color: mat-color($candy-app-primary) !default;
β ^^^^^^^^^^^^^^^^^^
β΅
C:\Users\Mykyta\Workspaces\Angular IDE\WebShopClientSSR\src\app\app.component.scss 9:27 root stylesheet
Can you please share your tsconfig.app.json
?
Hi @alan-agius4 ,
Warning about season.ts could be reasonable.
For app.component.scss warning. I renamed this file to _app.component.scss, so it should be treated as partial. But even after that, the same warning is there. The loader doesn't ignore underscored (partial) .scss files.
Archive with tsconfig.json and tsconfig.app.json: tsconfigs.zip
Hi,
The tsconfig's looks good.
Can you setup a minimal repro please? A good way to make a minimal repro is to create a new app via ng new repro-app
and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This might be related to your directory structure so its really important to get an accurate repro to diagnose this.
@alan-agius4 Link to reproduction project: https://github.com/luckynick/angular-devkit-bug-1/ In this repro, there are other errors besides old warnings.
Problem shows up in this piece of code. If you comment it and return null instead, there are no errors / warnings.
Strange is that I tried to use require() also here, and it doesn't cause any problems.
Hi @luckynick,
While using require()
for assets does work, this isn't something we have ever explicitly supported. Instead Webpack
, which we use, supports it, and we don't prevent its usage. In general we don't encourage or support using non-standard and webpack-specific features directly in user source code, because we don't want to commit to supporting them and they might break in future releases.
In this case changing your require
usage sounds like the best approach because otherwise we'd be half-heartedly trying to support something we never supported in the first place, and might even break other supported cases while trying.
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.
π Bug report
Command (mark with an
x
)Is this a regression?
The problem also was in NG7. I hoped it would be gone in NG9, but it is still there.
Description
There are lots of warnings when running ng build or ng serve. Looks like built-in Webpack of @angular-devkit/build-angular tries to process files which it shouldn't touch at all (like those in 'CVS' folder, which are used only by our version control system). Warnings reappear after each code recompilation. Such big amount of warning makes it problematic to track relevant errors of an application, in a way that quality of the development process gets worse.
See example of warnings: warnings.log
π¬ Minimal Reproduction
Could be useful:
Command: ng serve
Packages:
## π₯ Exception or Error First kind: Second kind: Third kind: ## π Your Environment **Anything else relevant?**