Skip to content

Unable to import from specific path in client handler #63

@FreePhoenix888

Description

@FreePhoenix888

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions