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

Error with ng build --prod #10

Closed
Gimenez93 opened this issue Mar 20, 2018 · 12 comments
Closed

Error with ng build --prod #10

Gimenez93 opened this issue Mar 20, 2018 · 12 comments
Assignees

Comments

@Gimenez93
Copy link

Gimenez93 commented Mar 20, 2018

Hi again, after solving #9 I'm trying to execute again "ng build --prod" and gives me this error:

ERROR in ./node_modules/angular4-hal/index.ts
Module build failed: Error: \node_modules\angular4-hal\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
at plugin.done.then (\node_modules@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)

ERROR in ./node_modules/angular4-hal/src/external.service.ts
Module build failed: Error:\node_modules\angular4-hal\src\external.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
at plugin.done.then (\node_modules@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)

ERROR in ./node_modules/angular4-hal/src/resource.service.ts
Module build failed: Error: \node_modules\angular4-hal\src\resource.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile \node_modules@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
at plugin.done.then \node_modules@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)

I checked the src folder and there isn't any of the files that give me the error and after some digging I found this #github.com/ng-cli#8284 and I think that I'm on the right track but not able to resolve it.

This is due a bad packaging? Because if I clone the project and try to compile by myself every .js is there normally... Thank you for your effort

@sante85 sante85 self-assigned this Mar 23, 2018
@sante85 sante85 closed this as completed Mar 28, 2018
@Gimenez93
Copy link
Author

Thanks again for your work but this update don't fix the problem for why I opened this issue. It's still complaining about the .ts and bad packaging, and failing when I'm trying to compile. On the other hand, If i delete the .ts that give me problems, my typescript doesn't find the functions of the library like, getAll(), getRelationArray(), etc...

@sante85
Copy link
Collaborator

sante85 commented Mar 28, 2018

update to 4.x

@sante85 sante85 reopened this Mar 28, 2018
@Gimenez93
Copy link
Author

I'm following your changes and my last message was about 4.3.1 version.

@sante85
Copy link
Collaborator

sante85 commented Mar 29, 2018

please get an running example, o plunker

@Gimenez93
Copy link
Author

Gimenez93 commented Apr 3, 2018

It's the same problem that #12 said, I'm working on a running example to show you but for me serve is working, build it's that fails to me

@Gimenez93
Copy link
Author

I have it already, now it's not failing when you do "ng build --prod" but the same error appears when you do "ng serve" so I supose that it will be the same problem
hal-fails.zip

@sante85
Copy link
Collaborator

sante85 commented Apr 9, 2018

ng-packagr/ng-packagr#727

"build": "ng build --prod --aot=false",

Is resolved

@Gimenez93
Copy link
Author

I really need AOT activated so please I can accept this workaround for now but please let the issue opened for the guys of ng-packagr issue that you referenced here they would see that the status is still pending.

Thanks.

@sante85
Copy link
Collaborator

sante85 commented Apr 18, 2018

my library work right. this is solution, contact angular team

@rogargon
Copy link
Contributor

Also experiencing the problem with AOT when running "ng serve -aot" or "ng build --prod". The error is:

ERROR in Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'AngularHalModule' was called.

Using: "angular4-hal": "^4.5.1"

The problem is with the line in app.module.ts imports:
...
AngularHalModule.forRoot(),
...

It disappears if I comment it out. Though, obviously, the application later crashes because it cannot find AngularHal.

The reason might be pointed out in the following example: https://github.com/jeffora/ng-barrel

@sante85
Copy link
Collaborator

sante85 commented Apr 27, 2018

ng-packagr/ng-packagr#727

"build": "ng build --prod --aot=false",

Is resolved

@rogargon
Copy link
Contributor

rogargon commented Apr 27, 2018 via email

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

3 participants