-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
aot build error with angular 5.1.2, ngx-clipboard: 9.0.0 #100
Comments
A lot of libraries have the same issue since this upgrade. |
in the dist/src/clipboard.service.spec.metadata.json file the content is: [null] this brings up the problem that i can't use the common fix for the problem to include the lib in the tsconfig because of this error webpack: Failed to compile.
Failed to read JSON file /Users/mtschimev/ownCloud/private_workspace/visual-testing-manager/node_modules/ngx-clipboard/dist/src/clipboard.service.spec.metadata.json
/Users/mtschimev/ownCloud/private_workspace/visual-testing-manager/node_modules/@angular/compiler-cli/src/transformers/program.js:478
throw e;
^
TypeError: Cannot read property 'version' of null
at readMetadataFile (/Users/mtschimev/ownCloud/private_workspace/visual-testing-manager/node_modules/@angular/compiler-cli/src/transformers/metadata_reader.js:66:29)
at Object.readMetadata (/Users/mtschimev/ownCloud/private_workspace/visual-testing-manager/node_modules/@angular/compiler-cli/src/transformers/metadata_reader.js:35:25)
at TsCompilerAotCompilerTypeCheckHostAdapter.getMetadataFor (/Users/mtschimev/ownCloud/private_workspace/visual-testing-manager/node_modules/@angular/compiler-cli/src/transformers/compiler_host.js:425:34) |
just build it again and the content was not anymore null tsconfig.app.ts ...
"exclude": ["test.ts", "**/*.spec.ts", "../node_modules/ngx-clipboard/**/*.spec.ts"],
"include": ["**/*.ts", "../node_modules/ngx-clipboard/*/**.ts"] Use 8.1.4 till 9 is getting fixed ! |
Thank You! It works |
With angular-cli 1.6.2, the error message is more specific:
|
Any chance of this getting fixed? I don't think there is a suitable workaround at this time. |
@achimha take a look at my fix. it is working for the moment |
What exactly is your fix? Use 8.1.4 and modify tsconfig.app.ts? |
On my project last version + tsconfig.app.ts works perfectly |
I have updated cli demo with latest cli and angular. It seems working without any issue. Can anyone confirm this? |
Confirmed. Upgrading to v9.0.1 removes the need to manually include ngx-clipboard dependency in tsconfig.app.ts. This ticket can be closed. Thank you for a great plugin @maxisam |
I don't see how the change in 9.0.1 would address the issue. The change is in the demo app. I still get the same error using 9.0.1.
|
With the exclusion in tsconfig as a workaround, 9.0.1 works for me. The ticket should be reopened. |
@achimha did you try demo code? Have you upgraded your package (Cli/Angular) to the latest version? |
My package uses Angular 5.1.3 and CLI 1.6.3. I don't see how a change to your demo app would fix this problem? |
@achimha You misunderstood what I meant. I mean it works in demo. I don't know why yours doesn't work. You might find a clue in demo to fix yours. |
Ok so i upgraded to 5.1.3 & 1.6.3 too but still have to keep the workaround in the tsconfig.app.ts |
@tfiwm Can you try cli demo code? |
@maxisam @achimha @tfiwm Hi all. I had the same issue with angular 5.1.3 and ngx-clipboard 9.0.1. I used typesctipt@2.6.2 and I noticed angular/cli warning about its version. It should be >= 2.4.2 and < 2.6.0. I set it as "~2.5.2" into my package.json then I updated dependencies. After that I've built the app with AoT successfully. Just check your typescript version. I hope it'll useful for you guys @achimha @tfiwm |
Hey folks! Just updated to 9.0.1 and prod build works like a charm 👍 $ ng -v
tsconfig.app.json
|
I'm on TypeScript 2.6.2 which is newer than the supported 2.5.x so this might be the reason. I had to go to it due to a bug that was addressed in 2.6. Still it's curious this this package is the only one of several dozens that causes the problem. |
@achimha There is an easy way to find out. Try Demo and update the typescript to 2.6 and see if it still works. |
I'm also experiencing this issue, but using version
my environment:
|
PS: comment #100 (comment) solves the issue, whoever this is a workaround and I guess the issue should be properly fixed @maxisam |
@ShinDarth could you try typescript 2.5? 2.6.2 is not official supported by Angular yet |
@maxisam it is supported: https://blog.angular.io/angular-5-2-now-available-312d1099bd81 |
How about CLI?
…On Jan 15, 2018 3:12 PM, "Francesco Borzì" ***@***.***> wrote:
@maxisam <https://github.com/maxisam> it is supported:
https://blog.angular.io/angular-5-2-now-available-312d1099bd81
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAb4ZypxPwP1nUuBHlEzXEqtKvj6n7igks5tK79YgaJpZM4RJtcR>
.
|
Hi @maxisam |
With typescript 2.5.3 it works |
this works for me as a temp solution in an nx-workspace with latest deps: (tsconfig.json)
highly recommend https://github.com/dherges/ng-packagr a decent setup if you're interested (trace scripts in package.json): https://github.com/ngx-plus/ngx-forms/blob/master/package.json#L48-L54 |
Using the most recent Angular, CLI, and ngx-clipboard packages, the highest version of TypeScript that worked for me with Any higher breaks the build with the " I didn't need to modify any other config files, include package.json: ...
"@angular/core": "^5.2.1",
"@angular/material": "^5.1.0",
"@angular/cli": "^1.6.4",
"ngx-clipboard": "^9.1.2",
"typescript": "^2.6.0-rc",
...
|
angular-cli 1.6.5 supports TypeScript 2.6.2 so this non working config is now the default config for current Angular projects. |
Cool, I will try to fix it this weekend.
…On Fri, Jan 19, 2018 at 3:09 AM, Achim Hasenmueller < ***@***.***> wrote:
angular-cli 1.6.5 supports TypeScript 2.6.2 so this non working config is
now the default config for current Angular projects.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAb4Z15x3OevveiVeCAIg-mwiQH1cWJnks5tMFvZgaJpZM4RJtcR>
.
|
Can anyone test |
Works great! 👍 |
the fix works, thanks a lot @maxisam |
Helme!! tsconfig.server.json: { Webpack.config.js const path = require('path'); module.exports = { comand: carlos@carlos-linux:~/Proyectos/website$ node dist/server.js SyntaxError: Unexpected token import |
@maxisam 9.1.3 is not working with TypeScript 2.6.2 None of the fixes work for me. |
Just sharing what worked for me with angular 5.2 Install this version tsconfig.app.json should look like this |
client:157 ./node_modules/ngx-clipboard/src/clipboard.directive.ts
Module build failed: Error: .../node_modules/ngx-clipboard/src/clipboard.directive.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (.../node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:649:23)
at plugin.done.then (.../node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:160:7)
@ ./src/app/modules/other/reset-password/reset-password.ngfactory.js 18:9-57
@ ./src/app/app.module.ngfactory.js
@ ./src/main.browser.ts
@ multi (webpack)-dev-server/client?http://0.0.0.0:8080 ./src/main.browser.ts
msgErrors @ client:157
onmessage @ socket.js:38
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1166
ZoneDelegate.invokeTask @ zone.js:425
Zone.runTask @ zone.js:192
ZoneTask.invokeTask @ zone.js:499
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:157 ./node_modules/ngx-clipboard/src/clipboard.service.ts
Module build failed: Error: .../node_modules/ngx-clipboard/src/clipboard.service.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (.../node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:649:23)
at plugin.done.then (.../node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:160:7)
@ ./src/app/app.module.ngfactory.js 53:10-56
@ ./src/main.browser.ts
@ multi (webpack)-dev-server/client?http://0.0.0.0:8080 ./src/main.browser.ts
msgErrors @ client:157
onmessage @ socket.js:38
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1166
ZoneDelegate.invokeTask @ zone.js:425
Zone.runTask @ zone.js:192
ZoneTask.invokeTask @ zone.js:499
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:157 ./node_modules/ngx-clipboard/src/index.ts
Module build failed: Error: .../node_modules/ngx-clipboard/src/index.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (.../node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:649:23)
at plugin.done.then (.../node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:160:7)
@ ./src/app/app.module.ngfactory.js 129:11-45
@ ./src/main.browser.ts
@ multi (webpack)-dev-server/client?http://0.0.0.0:8080 ./src/main.browser.ts
The text was updated successfully, but these errors were encountered: