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

[Stackblitz] Sample apps with one additional hierarchy level throw an error stating the data source file is missing #10

Open
gedinakova opened this issue Feb 5, 2021 · 1 comment
Assignees
Labels
bug Something isn't working status:in-review

Comments

@gedinakova
Copy link

The ExcelExportSample1Component has the following configuration:

configs.push(new Config({
            component: 'ExcelExportSample1Component',
            additionalFiles: ["/src/app/data/invoiceData.ts"],
            appModuleConfig: new AppModuleConfig({
                imports: ['IgxGridModule', 'IgxExcelExporterService', 'ExcelExportSample1Component', 'IgxButtonModule'],
                ngDeclarations: ['ExcelExportSample1Component'],
                ngImports: ['IgxGridModule', 'IgxButtonModule'],
                ngProviders: ['IgxExcelExporterService']
            }),
            shortenComponentPathBy: "/export-excel/"
        }));

The generated app has the data but the reference path is not the proper one, because in the sample itself the hierarchy is deeper and the path is import { INVOICE_DATA } from "../../../data/invoiceData"; .

image

@HristoP96
Copy link

HristoP96 commented Feb 16, 2021

This problem has 2 workarounds:
1 - change invoicedata.ts file location so that the final file structure fits the import statements
2 - remove the shortenComponentPathBy

The fix for this will include a lot of changes... We will have to first check if there is a shortenComponentPathBy for the respective config, if yes, then check the config's component content for relative paths and if yes then glue up all the path pieces for every additional import and the path pieces for the respective component for a config and if the relative path for the component does not fit the path for a single additional import. then change the relative path inside the component based on the value of shortenComponentPathBy.
@zdrawku I am not sure that this will be an efficient approach (it does not sound like one) for the solution of this issue, but for now it is all that we got, so should we continue with this issue or just postpone it and hope something better comes in as a plan?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:in-review
Projects
None yet
Development

No branches or pull requests

3 participants