1

I'm trying to load a static resource file in lightning web component which is running under vlocity_ins runtime. I'm getting the error Scoped imports are not allowed when runtime namespace is specified

import OmniscriptSelect from 'vlocity_ins/omniscriptSelect';
import template from './bhExtendedOmniscriptSelect.html';
import { loadStyle } from 'lightning/platformResourceLoader';
import newportoverride from '@salesforce/resourceUrl/newportoverride';

export default class BhExtendedOmniscriptSelect extends OmniscriptSelect {
    
    connectedCallback() {
        super.connectedCallback();
        this._realtimeOptions = this._realtimeOptions.filter(item => item.label !== '-- Clear --');

        Promise.all[(
            loadStyle(this, newportoverride + '/newport-override.css')
        )].then(() => {
            console.log('styles loaded');
        })
    }

    render() {
        return template;
    }
}

Below image shows error in omniscript when previewed on LWC preview tab Image shows the error in detail

2

Importing LWC component or static resource from another namespace is currently not supported as of today.

The locker service prevents this today. There is work in progress to support this in the future with safe harbor

There is an idea in the below link

https://trailblazer.salesforce.com/ideaView?id=0873A000000CaKLQA0

There is also a comment from PM on this on the below answer

Not being able to reference packaged custom LWCs from other LWCs outside the package

The alternative is to work with aura component or iframe VF page inside LWC

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.