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

Support for Angular 16.x #2163

Open
zamadaouf opened this issue Sep 25, 2023 · 6 comments
Open

Support for Angular 16.x #2163

zamadaouf opened this issue Sep 25, 2023 · 6 comments

Comments

@zamadaouf
Copy link

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

Expected behavior

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Table version:

  • Angular version:

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

@mhamri
Copy link

mhamri commented Oct 28, 2023

the ngx-table isn't working with angular 16.2.0

in style.scss

@use '@swimlane/ngx-datatable/index.css';

@use '@swimlane/ngx-datatable/themes/material.css';
@use '@swimlane/ngx-datatable/assets/icons.css';

it produces this error:


./apps/module-desktop/src/styles.scss - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/dist/cjs.js):
Can't find stylesheet to import.
  ╷
3 │ @use '@swimlane/ngx-datatable/index';
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  apps\module-desktop\src\styles.scss 3:1  root stylesheet

./apps/module-desktop/src/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Package path ./index.css is not exported from package C:\repo\App\frontend\node_modules\@swimlane\ngx-datatable (see exports field in C:\repo\App\frontend\node_modules\@swimlane\ngx-datatable\package.json)

@supremeqwert
Copy link

supremeqwert commented Nov 1, 2023

Workaround: Put the styles path directly to node_modules in global.scss:
@import '../node_modules/@swimlane/ngx-datatable/index.css'; @import '../node_modules/@swimlane/ngx-datatable/themes/material.css'; @import '../node_modules/@swimlane/ngx-datatable/assets/icons.css';

@jaws97
Copy link

jaws97 commented Nov 17, 2023

1. If 'ngx-datatable-column' is an Angular component and it has 'width' input, then verify that it is part of this module.
2. If 'ngx-datatable-column' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

I'm getting this error with Material 16 and Angular 16, any work around for this ?

My Package.json

    "@angular/animations": "^16.2.12",
    "@angular/cdk": "^16.2.12",
    "@angular/common": "^16.2.12",
    "@angular/compiler": "^16.2.12",
    "@angular/core": "^16.2.12",
    "@angular/flex-layout": "^15.0.0-beta.42",
    "@angular/forms": "^16.2.12",
    "@angular/material": "^16.2.12",
    "@angular/material-moment-adapter": "^16.2.12",
    "@angular/platform-browser": "^16.2.12",
    "@swimlane/ngx-charts": "^20.1.0",
    "@swimlane/ngx-datatable": "^20.1.0",

@thatcort
Copy link

Workaround: Put the styles path directly to node_modules in global.scss: @import '../node_modules/@swimlane/ngx-datatable/index.css'; @import '../node_modules/@swimlane/ngx-datatable/themes/material.css'; @import '../node_modules/@swimlane/ngx-datatable/assets/icons.css';

This didn't work for me

@Abadii
Copy link

Abadii commented Jan 25, 2024

1. If 'ngx-datatable-column' is an Angular component and it has 'width' input, then verify that it is part of this module.
2. If 'ngx-datatable-column' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

I'm getting this error with Material 16 and Angular 16, any work around for this ?

My Package.json

    "@angular/animations": "^16.2.12",
    "@angular/cdk": "^16.2.12",
    "@angular/common": "^16.2.12",
    "@angular/compiler": "^16.2.12",
    "@angular/core": "^16.2.12",
    "@angular/flex-layout": "^15.0.0-beta.42",
    "@angular/forms": "^16.2.12",
    "@angular/material": "^16.2.12",
    "@angular/material-moment-adapter": "^16.2.12",
    "@angular/platform-browser": "^16.2.12",
    "@swimlane/ngx-charts": "^20.1.0",
    "@swimlane/ngx-datatable": "^20.1.0",

I had the same error after upgrading to Angular 16

I my case, the problem was the angular modules that I imported from other external packages. Go trough app.module.ts to all imported modules you use, and check if there is an error within those files. If so, try to upgrade all the external modules you use.

This error has nothing to do with the ngx-datatable, but rather other modules you import which makes all the modules broken and thus the ngx-datatable could not be resolved.

@Abadii
Copy link

Abadii commented Jan 25, 2024

Workaround: Put the styles path directly to node_modules in global.scss: @import '../node_modules/@swimlane/ngx-datatable/index.css'; @import '../node_modules/@swimlane/ngx-datatable/themes/material.css'; @import '../node_modules/@swimlane/ngx-datatable/assets/icons.css';

This didn't work for me

Maybe too obvious, but to ensure the correct import of the .scss file, it's important to understand the relative paths in your project's directory structure:

If your style.scss file is located in the src directory, you should use the following import statement:

@import '../node_modules/@swimlane/ngx-datatable/index.css';

In this case, ../ signifies moving up one directory level to reach the project's root, and then navigating to the desired node_modules directory.

However, if your scss file is located in a deeper folder, such as src/css, you'll need to adjust the import statement accordingly. Here's how it should look:

@import '../../node_modules/@swimlane/ngx-datatable/index.css';

In this example, we've used ../../ to move up two directory levels to reach the project's root, and then proceeded to the node_modules directory.

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

6 participants