Skip to content

error logged in console when ComfyUI-Texture-Simple is active. #9

@lerignoux

Description

@lerignoux

When opening comfy there is an error because of the threeVizualizer file

extensionService.ts:40 Error loading extension /extensions/ComfyUI-Texture-Simple/js/threeVisualizer.js TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".

The issue as I understand it is that three module is not loaded in Comfy index.html.
We could try to avoid loading this file from Comfy possibly.
Or we could load it automatically by adding a bit of JS possibly:

function initThree() {
    // Check if importmap already exists to avoid duplicates
    if (document.querySelector('script[type="importmap"]')) {
        return;
    }

    // Create the importmap script element
    const importMapScript = document.createElement('script');
    importMapScript.type = 'importmap';
    importMapScript.textContent = JSON.stringify({
        imports: {
		"three": "../js/three/build/three.module.js",
		"three/addons": "../js/three/examples/jsm"
        }
    }, null, 2);


    // Add the importmap to the document head
    document.head.appendChild(importMapScript);
}

It is not really breaking anything but I guess would be cleaner.
Do you have the same issue, would it be ok to fix it ? I can try to provide a MR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions