pdfViewer icon indicating copy to clipboard operation
pdfViewer copied to clipboard

missing c:ldsUtils

Open fabricepierre opened this issue 6 years ago • 13 comments

Hello, I am missing a module, any idea?

N/A No MODULE named markup://c:ldsUtils found : [markup://c:showPdfRelatedToRecordId, markup://c:errorPanel]

fabricepierre avatar Aug 30 '19 12:08 fabricepierre

Same here, did you manage to get it to work? @fabricepierre

Vahlstorm avatar Nov 05 '19 10:11 Vahlstorm

Hello,

I could resolve this error. We have piece of code in https://github.com/trailheadapps/lwc-recipes/tree/master/force-app/main/default/lwc/ldsUtils

Please create LWC and incorporate the ldsUtil js and metadata file and then try to push code Org. it will get succeed.

Thank you, Harsha

sharshaprasad avatar Mar 31 '20 06:03 sharshaprasad

Can you post your complete error in below link: Need to understand more, paste your code in GitHub.

https://github.com/annyhe/pdfViewer/issues/3

On Thu, Jul 16, 2020 at 9:21 PM Beelzebubdevelop [email protected] wrote:

I have same problem, @sharshaprasad https://github.com/sharshaprasad your fix don't work, this is error now: noDataErrorIllustration of type resourceUrl in file errorPanel.js

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/annyhe/pdfViewer/issues/3#issuecomment-659502170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHNALOAOCHQXQGIZOHWTQGTR34OXPANCNFSM4ISM3QWA .

sharshaprasad avatar Jul 16 '20 22:07 sharshaprasad

In the errorPanel.js file, the import statement referencing the idsUtils file has a typo (there is a "L" instead of an "i" - mixed capitalization for emphasis).

It reads: import { reduceErrors } from 'c/ldsUtils'; It should be: import { reduceErrors } from 'c/idsUtils';

Update the typo so that you reference the correct file. For example:

import { LightningElement, api, track } from 'lwc';
import { reduceErrors } from 'c/idsUtils';

export default class ErrorPanel extends LightningElement {
    /** Generic / user-friendly message */
    @api friendlyMessage = 'Error retrieving data';
...

sviereckl avatar Sep 11 '20 15:09 sviereckl

It's very Simple to solve this error...............

Step1:- Create a LWC named "ldsUtils"

****Step2: Paste the Below Code as given in ldsUtils.js ****

/**
 * Reduces one or more LDS errors into a string[] of error messages.
 * @param {FetchResponse|FetchResponse[]} errors
 * @return {String[]} Error messages
 */
export function reduceErrors(errors) {
    if (!Array.isArray(errors)) {
        errors = [errors];
    }

    return (
        errors
            // Remove null/undefined items
            .filter((error) => !!error)
            // Extract an error message
            .map((error) => {
                // UI API read errors
                if (Array.isArray(error.body)) {
                    return error.body.map((e) => e.message);
                }
                // UI API DML, Apex and network errors
                else if (error.body && typeof error.body.message === 'string') {
                    return error.body.message;
                }
                // JS errors
                else if (typeof error.message === 'string') {
                    return error.message;
                }
                // Unknown error shape so try HTTP status text
                return error.statusText;
            })
            // Flatten
            .reduce((prev, curr) => prev.concat(curr), [])
            // Remove empty strings
            .filter((message) => !!message)
    );
}

Step3: Don't make any changes in "ldsUtils.html" and "ldsUtils.js-meta.xml" files

Step4:Deploy the "ldsUtils" Component to your Org

Step5: After this deploy the component in which you mentioned "ldsUtils"as "import { reduceErrors } from 'c/ldsUtils';"

Step6: Hurray!! Your issue is resolved

Thanks and regards, Aman Anil Tiwari.

amantiwari9619 avatar Sep 25 '20 19:09 amantiwari9619

thanks for your solution , @amantiwari9619 . It worked like a charm!

Subhasis703 avatar Oct 11 '20 10:10 Subhasis703

Thanks @amantiwari9619 ! It worked for me.

AliSiddiqui97 avatar Jan 31 '21 17:01 AliSiddiqui97

Glad to hear from you 😁🤗

On Sun, Jan 31, 2021, 10:36 PM Muhammed Ali Siddiqui < [email protected]> wrote:

Thanks @amantiwari9619 https://github.com/amantiwari9619 ! It worked for me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/annyhe/pdfViewer/issues/3#issuecomment-770414448, or unsubscribe https://github.com/notifications/unsubscribe-auth/APK6Z4IBTS3O7KISSMOFTCDS4WE2VANCNFSM4ISM3QWA .

amantiwari9619 avatar Jan 31 '21 18:01 amantiwari9619

Thanks @amantiwari9619 It worked for me.

Ani0511 avatar Mar 06 '21 05:03 Ani0511

\force-app\main\default\lwc-recipes\ldsUtils\ldsUtils.js: Could not infer a metadata type getting this error while deploying ldsUtil js file

Ruchikumari98 avatar Sep 07 '21 12:09 Ruchikumari98

Aman Anil Tiwari - Thank you SO MUCH for posting. That did the trick!!!

mpatchen avatar Sep 19 '21 16:09 mpatchen

Thanks @amantiwari9619 It worked for me.

bogdann1ron avatar Jan 10 '22 10:01 bogdann1ron

Thanks Anil Tiwari !! Your suggestion helped.

sudhakarbsks avatar May 11 '22 19:05 sudhakarbsks