deep-foundation / deep-foundation/deepcase

Unable to import from specific path in client handler

Open
#63 0 comments 0 reactions 1 assignee Claimed by @konard View on GitHub
bug
Dominant language
TypeScript
Stars
7
Forks
6
PR merge metrics
No merged PRs in 30d

Description

# Question
Unable to import from specific path in client handler

# Code 1
```ts
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
```ts
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
```ts
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
```ts
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
```ts
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.