-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New import system fails under AOT #4841
Comments
Same thing for me. In fact, when I take this example I have the same problem too : When I updated the package I had Is there a particular dependy that I would need ? PS : everything works fine If I don't import with PS2: @cagataycivici I don't have any .d.ts file except primeng.d.ts in the package folder... (all .js files importing components are present though) |
@MedinaGitHub Can you share whatever errors you're getting? That would help the debugging process I'm sure. Also what version of Angular are you using? I suspect there may be an issue when trying to use the latest version of PrimeNG with an older version of Angular (below v5.0). |
I'm seeing similar issues after upgrading. I'm using primeng 5.2.0-rc.1 and Angular 5.2.1. I imported the new TableModule into my app.module file as described in the documentation, but the IDE (Visual Studio Code) isn't recognizing it as a component. That being said, it is working in my app, so it seems like a false negative...
|
It works for me at primeng-quickstart-cli, please compare; https://github.com/primefaces/primeng-quickstart-cli I'm unable to replicate. |
@cagataycivici : With ng build --watch, everything works. When trying to ng build --prod: Unexpected value 'TableModule in C:/www/struktur/protected/views/hyperion/node_modules/primeng/table.js' imported by the module 'ProjectModule in
|
update: The problem is that I can't seem to import TableModule from "primeng/primeng" which in the Calendar case seems to fix it. |
We've got the exact same issue in a project too, with the build --prod and it happens for the Table but also if we try to import an element with the new import style 'primeng/element' |
tried adding export * from './components/table/table'; to node_modules/primeng/primeng.d.ts but get the following intellisence error: [ts] Module './components/datatable/datatable' has already exported a member named 'ScrollableView'. Consider explicitly re-exporting to resolve the ambiguity. |
Okay, took another approach. Adding the file table.d.ts in node_modules/primeng with the code
made it work. Every other module than table needs to be imported from "primeng/primeng" when building with --prod. |
Having same issue. Seems to be AOT related. Building without AOT or prod flag builds ok with new 'primeng/[component_name]' pathing. With AOT need to use old pathing 'primeng/primeng' or the full path to component |
@bias-keenly You are right. It looks AOT issue. When I run by |
I've replicated the situation, thank you for the feedback. For my case it only happens on AOT build with prod. Adding d.ts files fixes this, so we'll do an 5.2.RC2 on 22nd with these changes. |
d.ts files of single modules will also be published to npm now which fixes the issue. |
When will RC2 be available? |
It just became available, and it works! Thanks! :) |
It does not seem to be fixed. |
import { TableModule } from 'primeng/table'; |
Sorry, we can't replicate and many users reported that issue is fixed. |
I had the same issue, and also with MultiSelectModule so I had to do this: //other prime components // components that caused building for prod errors... and now it works In Dev mode, everything works fine |
Why is it that primeng.js (and prime.d.ts) at the root of the project does not contain an export for the new Table component? It's the only module missing and perhaps is causing some of the odd behavior. It doesn't appear to be needed in my code, but its still odd that no export exists here. |
it is weird that in order to import TableModule I need to use |
This is still an issue experiencing with [email protected]. Is generic import from 'primeng/primeng' the solution moving forward too? |
I want to use the new turboTable but my import doesn't work
The text was updated successfully, but these errors were encountered: