Jordan-Hall / angular-material-rail-drawer-plugin

Angular Material extension for mini/rail drawer variant
Other
47 stars 13 forks source link

Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s). #51

Closed andrelutza closed 1 year ago

andrelutza commented 2 years ago

I am trying to integrate the rail into my project, and this is the error I am getting:

./node_modules/angular-material-rail-drawer/fesm2015/angular-material-rail-drawer.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js): TypeError: Cannot create property 'message' on string 'C:\baroloop\github\RPM-Frontend\node_modules\angular-material-rail-drawer\fesm2015\angular-material-rail-drawer.mjs: This application depends upon a library published using Angular version 14.0.6, which requires Angular version 14.0.0 or newer to work correctly. Consider upgrading your application to use a more recent version of Angular. at C:\baroloop\github\RPM-Frontend\node_modules\gensync\index.js:113:33 at step (C:\baroloop\github\RPM-Frontend\node_modules\gensync\index.js:287:14) at C:\baroloop\github\RPM-Frontend\node_modules\gensync\index.js:273:13 at async.call.result.err.err (C:\baroloop\github\RPM-Frontend\node_modules\gensync\index.js:223:11) Error: node_modules/angular-material-rail-drawer/lib/drawer-rail.directive.d.ts:27:18 - error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s).

27 static ɵdir: i0.ɵɵDirectiveDeclaration<MatDrawerRailDirective, "mat-sidenav[mode=\"rail\"], mat-drawer[mode=\"rail\"], mat-sidenav[rail-mode], mat-drawer[rail-mode]", never, { "openAnimation": "openAnimation"; "closeAnimation": "closeAnimation"; "closeWidth": "closeWidth"; "expandedWidth": "expandedWidth"; }, {}, never, never, false>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any ideas how to fix this? Thanks in advance!

FortisVoid commented 2 years ago

"This application depends upon a library published using Angular version 14.0.6, which requires Angular version 14.0.0 or newer to work correctly. Consider upgrading your application to use a more recent version of Angular."

It would appear that your app's angular version is not compatible.

GabrielBragaGit commented 1 year ago

Just use the 1.0.0 version...

thxmike commented 1 year ago

I get a similar error on version 14.1.1. Below is the verbose log of ng build. I did try to use v1.0.0 but there is a dependency error.

`Generating browser application bundles (phase: setup)... [webpack.cache.PackFileCacheStrategy] No pack exists at /Users/michaelrivera/Projects/public-api/developer-portal/.angular/cache/14.2.11/angular-webpack/b9bf6ec76a68bc0d6d8cd3ae05738b5046ddfdab.pack: Error: ENOENT: no such file or directory, stat '/Users/michaelrivera/Projects/public-api/developer-portal/.angular/cache/14.2.11/angular-webpack/b9bf6ec76a68bc0d6d8cd3ae05738b5046ddfdab/index.pack'

[webpack.cache.PackFileCacheStrategy] restore cache container: 7.114292 ms ⠋ Generating browser application bundles (phase: sealing)... [IdleFileCachePlugin] Initial cache was generated and cache will be persisted in 5s. ✔ Browser application bundle generation complete. [webpack.cache.PackFileCacheStrategy] Pack got invalid because of write to: ResolverCachePlugin|normal|default|dependencyType=|esm|path=|/Users/michaelrivera/Projects/public-api/developer-portal|request=|/Users/michaelrivera/Projects/public-api/developer-portal/src/main.ts asset main.b6b0c40f1a10ac23.js 587 KiB {179} [cached] [immutable] (name: main) asset scripts.2a4afb1b377abeda.js 92.3 KiB {scripts} [cached] (name: scripts) asset styles.9bc278da44f1c244.css 84.1 KiB {532} [cached] [immutable] (name: styles) asset polyfills.4e9d5729310ff7b7.js 36.2 KiB {429} [cached] [immutable] (name: polyfills) asset 3rdpartylicenses.txt 19.9 KiB [cached] asset runtime.3214cba02fb346fb.js 1.06 KiB {666} [cached] [immutable] (name: runtime) Entrypoint main = runtime.3214cba02fb346fb.js main.b6b0c40f1a10ac23.js Entrypoint polyfills = runtime.3214cba02fb346fb.js polyfills.4e9d5729310ff7b7.js Entrypoint styles = runtime.3214cba02fb346fb.js styles.9bc278da44f1c244.css Entrypoint scripts = scripts.2a4afb1b377abeda.js chunk {179} (runtime: runtime) main.b6b0c40f1a10ac23.js (main) 4.36 MiB [initial] [rendered] ./src/main.ts + 181 modules [800] 4.36 MiB {179} [built] [code generated] [no exports used] entry /Users/michaelrivera/Projects/public-api/developer-portal/src/main.ts main chunk {429} (runtime: runtime) polyfills.4e9d5729310ff7b7.js (polyfills) 112 KiB [initial] [rendered] dependent modules 109 KiB [dependent] 1 module ./src/polyfills.ts [435] 2.28 KiB {429} [built] [code generated] [no exports used] Dependency (harmony side effect evaluation) with side effects at 48:0-17 ModuleConcatenation bailout: Cannot concat with ./node_modules/zone.js/fesm2015/zone.js: Module is not an ECMAScript module entry /Users/michaelrivera/Projects/public-api/developer-portal/src/polyfills.ts polyfills chunk {532} (runtime: runtime) styles.9bc278da44f1c244.css (styles) 200 bytes (javascript) 99 KiB (css/mini-extract) [initial] [rendered] dependent modules 99 KiB [dependent] 4 modules ./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css [274] 50 bytes {532} [built] [code generated] [no exports used] entry /Users/michaelrivera/Projects/public-api/developer-portal/node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css styles ./node_modules/prismjs/themes/prism-okaidia.css [139] 50 bytes {532} [built] [code generated] [no exports used] entry /Users/michaelrivera/Projects/public-api/developer-portal/node_modules/prismjs/themes/prism-okaidia.css styles ./src/styles/styles.scss [538] 50 bytes {532} [built] [code generated] [no exports used] entry /Users/michaelrivera/Projects/public-api/developer-portal/src/styles/styles.scss styles ./src/styles/themes/florence-theme.scss [190] 50 bytes {532} [built] [code generated] [no exports used] entry /Users/michaelrivera/Projects/public-api/developer-portal/src/styles/themes/florence-theme.scss styles chunk {666} (runtime: runtime) runtime.3214cba02fb346fb.js (runtime) 3.05 KiB [entry] [rendered] runtime modules 3.05 KiB 5 modules chunk {scripts} scripts.2a4afb1b377abeda.js (scripts) [initial] [rendered] LOG from webpack.Compilation runtime requirements.modules: 0.120625 ms runtime requirements.chunks: 0.081875 ms runtime requirements.entries: 0.645166 ms runtime requirements.modules: 0.082708 ms runtime requirements.chunks: 0.014083 ms runtime requirements.entries: 0.136625 ms runtime requirements.modules: 0.070875 ms runtime requirements.chunks: 0.019042 ms runtime requirements.entries: 0.15975 ms runtime requirements.modules: 0.018875 ms runtime requirements.chunks: 0.012958 ms runtime requirements.entries: 0.177041 ms compute affected modules: 0.001791 ms finish modules: 16.739625 ms report dependency errors and warnings: 8.586708 ms optimize dependencies: 19.03075 ms create chunks: 6.942292 ms compute affected modules with chunk graph: 0.002167 ms optimize: 34.8945 ms 11 modules hashed, 0 from cache (0.03 variants per module in average) module hashing: 13.253125 ms 100% code generated (11 generated, 0 from cache) code generation: 558.892125 ms runtime requirements.modules: 0.099667 ms runtime requirements.chunks: 0.098083 ms runtime requirements.entries: 0.58825 ms runtime requirements: 0.992167 ms hashing: initialize hash: 0.009375 ms hashing: hash errors: 0.001875 ms hashing: sort chunks: 0.028166 ms hashing: hash runtime modules: 0.713625 ms hashing: hash chunks: 1.000334 ms hashing: hash digest: 0.024583 ms hashing: process full hash modules: 0.00125 ms hashing: 1.839333 ms 100% code generated (5 generated, 0 from cache) module assets: 0.126792 ms create chunk assets: 2.104792 ms process assets: 4438.952875 ms LOG from webpack.Compiler make hook: 2474.294708 ms finish make hook: 0.083667 ms finish compilation: 25.3555 ms seal compilation: 5078.792584 ms afterCompile hook: 0.13775 ms LOG from webpack.ResolverCachePlugin 27% really resolved (683 real resolves with 0 cached but invalid, 1823 cached valid, 0 concurrent) LOG from webpack.FlagDependencyExportsPlugin restore cached provided exports: 1.021708 ms figure out provided exports: 9.263542 ms 93% of exports of modules have been determined (23 no declared exports, 305 not cached, 0 flagged uncacheable, 0 from cache, 0 from mem cache, 4 additional calculations due to dependencies) store provided exports into cache: 1.48475 ms LOG from webpack.InnerGraphPlugin infer dependency usage: 9.17996 ms LOG from webpack.SideEffectsFlagPlugin update dependencies: 6.767666 ms LOG from webpack.FlagDependencyUsagePlugin initialize exports usage: 0.462042 ms trace exports usage in graph: 11.500208 ms LOG from webpack.buildChunkGraph visitModules: prepare: 4.512551 ms visitModules: visiting: 5.367417 ms 419 queue items processed (192 blocks) 0 chunk groups connected 0 chunk groups processed for merging (0 module sets, 0 forked, 0 + 0 modules forked, 0 + 0 modules merged into fork, 0 resulting modules) 0 chunk group info updated (0 already connected chunk groups reconnected) visitModules: 5.423958 ms connectChunkGroups: 0.002834 ms cleanup: 0.00075 ms LOG from webpack.SplitChunksPlugin prepare: 0.02975 ms modules: 2.329917 ms queue: 0.014458 ms maxSize: 0.028875 ms LOG from webpack.ModuleConcatenationPlugin select relevant modules: 1.533167 ms sort relevant modules: 0.173875 ms find modules to concatenate: 13.641125 ms sort concat configurations: 0.000959 ms create concatenated modules: 8.645333 ms + 3 hidden lines LOG from build-angular.JavaScriptOptimizerPlugin optimize asset: runtime.85178b18d65e2ae9.js: 183.64625 ms optimize asset: polyfills.77510d9bc59ee9fc.js: 518.155542 ms optimize asset: scripts.[contenthash:20].js: 638.335792 ms optimize asset: main.b5320442e81e2b53.js: 3484.860875 ms optimize js assets: 3564.665667 ms LOG from build-angular.CssOptimizerPlugin optimize asset: styles.9d23f0734be34283.css: 9.717042 ms optimize css assets: 15.986875 ms LOG from webpack.FileSystemInfo 992 new snapshots created 0% root snapshot uncached (0 / 1823) 0% children snapshot uncached (0 / 0) 0 entries tested File info in cache: 276 timestamps 43 hashes 43 timestamp hash combinations File timestamp snapshot optimization: 51% (36/70) entries shared via 2 shared snapshots (2 times referenced) File timestamp hash combination snapshot optimization: 83% (4199/5067) entries shared via 9 shared snapshots (676 times referenced) Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations Missing items snapshot optimization: 77% (1117/1450) entries shared via 32 shared snapshots (194 times referenced) Managed items info in cache: 122 items Managed items snapshot optimization: 31% (543/1731) entries shared via 27 shared snapshots (120 times referenced) Managed files snapshot optimization: 78% (3831/4939) entries shared via 188 shared snapshots (861 times referenced) Managed missing snapshot optimization: 84% (4392/5233) entries shared via 251 shared snapshots (775 times referenced) ERROR in node_modules/angular-material-rail-drawer/lib/drawer-rail.directive.d.ts:27:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments. 27 static ɵdir: i0.ɵɵDirectiveDeclaration; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: node_modules/angular-material-rail-drawer/lib/drawer-rail.directive.d.ts:27:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments. 27 static ɵdir: i0.ɵɵDirectiveDeclaration; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ at addError (/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@ngtools/webpack/src/ivy/diagnostics.js:31:29) at /Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@ngtools/webpack/src/ivy/diagnostics.js:17:17 at AngularWebpackPlugin.updateAotProgram (/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@ngtools/webpack/src/ivy/plugin.js:399:17) at AngularWebpackPlugin.setupCompilation (/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@ngtools/webpack/src/ivy/plugin.js:211:20) at /Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@ngtools/webpack/src/ivy/plugin.js:131:22 at Hook.eval [as call] (eval at create (/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/tapable/lib/HookCodeFactory.js:19:10), :24:1) at Hook.CALL_DELEGATE [as _call] (/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/tapable/lib/Hook.js:14:14) at Compiler.newCompilation (/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/webpack/lib/Compiler.js:1121:30) at /Users/michaelrivera/Projects/public-api/developer-portal/node_modules/webpack/lib/Compiler.js:1166:29 at eval (eval at create (/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/tapable/lib/HookCodeFactory.js:33:10), :31:1) 2023-06-17 18:14:00: webpack 5.76.1 compiled in 9513 ms (67059a6b456ad94e) [webpack.cache.PackFileCacheStrategy] Storing pack... [webpack.cache.PackFileCacheStrategy] Capturing build dependencies... () [webpack.cache.PackFileCacheStrategy] resolve build dependencies: 1.832625 ms [webpack.cache.PackFileCacheStrategy] snapshot build dependencies: 0.53025 ms [webpack.cache.PackFileCacheStrategy] Captured build dependencies [webpack.cache.PackFileCacheStrategy] 1371 fresh items in cache put into pack 0 [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/modules|javascript/esm|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular/core/fesm2020/core.mjs': 1.651292 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/modules|javascript/esm|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular/platform-browser/fesm2020/platform-browser.mjs': 2.169167 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/modules|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@ngtools/webpack/src/ivy/index.js!/Users/michaelrivera/Projects/public-api/developer-portal/src/app/components/navigation/navigation.component.ts': 1.759875 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/modules|javascript/esm|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular/material/fesm2020/datepicker.mjs': 2.617167 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/modules|javascript/esm|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular/router/fesm2020/router.mjs': 1.356833 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/modules|javascript/esm|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/angular-material-rail-drawer/fesm2020/angular-material-rail-drawer.mjs': 1.177083 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/modules|javascript/esm|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular/cdk/fesm2020/overlay.mjs': 3.39125 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'FlagDependencyExportsPlugin|javascript/esm|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular/material/fesm2020/core.mjs': 1.119041 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/codeGeneration|/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js??ruleSet[1].rules[2].use[0]!/Users/michaelrivera/Projects/public-api/developer-portal/node_modules/@ngtools/webpack/src/ivy/index.js!/Users/michaelrivera/Projects/public-api/developer-portal/src/main.ts|716980d7631b7f63|runtime': 18.816708 ms [webpack.cache.PackFileCacheStrategy] Serialization of 'Compilation/assets|chunk179': 12.31375 ms [webpack.cache.PackFileCacheStrategy] store pack: 254.344875 ms [webpack.cache.PackFileCacheStrategy] Stored pack (1371 items, 1 files, 65 MiB) Error: node_modules/angular-material-rail-drawer/lib/drawer-rail.directive.d.ts:27:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments. 27 static ɵdir: i0.ɵɵDirectiveDeclaration; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `
thxmike commented 1 year ago

After reviewing the following stack overflow, https://stackoverflow.com/questions/74616687/error-ts2707-generic-type-%C9%B5%C9%B5directivedeclaration-requires-between-6-and-8-type I removed the last never in the type declaration in node_modules/angular-material-rail-drawer/lib/drawer-rail.directive.d.ts:27:18

I changed this: static ɵdir: i0.ɵɵDirectiveDeclaration<MatDrawerRailDirective, "mat-sidenav[mode=\"rail\"], mat-drawer[mode=\"rail\"], mat-sidenav[rail-mode], mat-drawer[rail-mode]", never, { "openAnimation": "openAnimation"; "closeAnimation": "closeAnimation"; "closeWidth": "closeWidth"; "expandedWidth": "expandedWidth"; }, {}, never, never, false, never>;

To this: static ɵdir: i0.ɵɵDirectiveDeclaration<MatDrawerRailDirective, "mat-sidenav[mode=\"rail\"], mat-drawer[mode=\"rail\"], mat-sidenav[rail-mode], mat-drawer[rail-mode]", never, { "openAnimation": "openAnimation"; "closeAnimation": "closeAnimation"; "closeWidth": "closeWidth"; "expandedWidth": "expandedWidth"; }, {}, never, never, false>;

This allows "ng build" to complete

Jordan-Hall commented 1 year ago

If this is still an issue let me know. I'm only going to support up to last release of 16 Issue closed please read https://github.com/Jordan-Hall/angular-material-rail-drawer-plugin/issues/56

Happy to reopen this issue if it exists. Seems like a bulid issue