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

Unable to import from specific path in client handler #63

Open
FreePhoenix888 opened this issue Mar 3, 2024 · 0 comments
Open

Unable to import from specific path in client handler #63

FreePhoenix888 opened this issue Mar 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@FreePhoenix888
Copy link
Member

Question

Unable to import from specific path in client handler

Code 1

const {FinderPopover} = await deep.import("@deep-foundation/deepcase/imports/cyto/hooks.js"); 

Error 1

evalClientHandler error Error: Cannot find module '@deep-foundation/deepcase/imports/cyto/hooks.js'
    at index.js:15386:11

Code 2

const {FinderPopover} = await deep.import("@deep-foundation/deepcase/imports/cyto/hooks"); 

Error 2

evalClientHandler error Error: Cannot find module '@deep-foundation/deepcase/imports/cyto/hooks'
    at index.js:15386:11

Code 3

const {FinderPopover} = await deep.import("./imports/cyto/hooks"); 

Error 3

evalClientHandler error Error: Cannot find module './imports/cyto/hooks'
    at index.js:15386:11

Code 4

const {FinderPopover} = await deep.import("./imports/cyto/hooks.js"); 

Error 4

evalClientHandler error Error: Cannot find module './imports/cyto/hooks.js'
    at index.js:15386:11

Additional Info

I am able to import deepcase

Code

  const deepcaseImport = await deep.import("@deep-foundation/deepcase");  
  console.log({deepcaseImport})
{
    "deepcaseImport": {
        "CustomizableIcon": {
            "compare": null
        },
        "Resize": {
            "compare": null
        },
        "EditorTextArea": {
            "compare": null
        },
        "ClientHandler": {
            "compare": null
        },
        "CytoReactLinkAvatar": {
            "compare": null
        },
        "DeepWysiwyg": {
            "compare": null
        },
        "BlockButton": {
            "compare": null
        }
    }
}

But unable to import if there is anything going after package name like /cyto/hooks

This problem is not related to only deepcase but to other packages which do not contain entry-point file that exports everything. For example react exports everything so I can do this:

  const React = await deep.import("react");
  const { useState , useMemo} = React;

Note: I do not destructure useState and useMemo immediately because React should be imported itself otherwise I get error related to createElement is undefined or smth like that

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

No branches or pull requests

2 participants