-
Notifications
You must be signed in to change notification settings - Fork 6
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
How to add dependency to client handler? #60
Comments
It is module, so looks like the correct way to add dependency to ClientHandler.
See browser console, there might be an error on JSX/TSX compilation. Also, please do not import Note that after switching to fork of |
The changes I have made to deepcase:https://github.com/deep-foundation/deepcase/pull/61/files Note that I have installed the dependency by using Working Client Handler Code (Without importing the library, with Importing other libraries by using require)async ({ deep, require }) => {
const React = require('react');
const { Box,Button } = require('@chakra-ui/react');
// const { generateMessages, getAllCoolOrders } = require("@likissdmd/warframe-market-prime-trash-buyer")
return ({ fillSize, style, link }) => {
return <Box
style={{ width: 300, height: 300, ...style }}
bg={'bgColor'}
color={'text'}
borderColor={'borderColor'}
borderWidth='thin'
borderWidth='1px' borderRadius='lg'
padding={1}
>
<Button>
Generate Messages
</Button>
</Box>
}
} Not Working Client Handler Code (Importing the library by using require)async ({ deep, require }) => {
const React = require('react');
const { Box,Button } = require('@chakra-ui/react');
const { generateMessages, getAllCoolOrders } = require("@likissdmd/warframe-market-prime-trash-buyer")
return ({ fillSize, style, link }) => {
return <Box
style={{ width: 300, height: 300, ...style }}
bg={'bgColor'}
color={'text'}
borderColor={'borderColor'}
borderWidth='thin'
borderWidth='1px' borderRadius='lg'
padding={1}
>
<Button>
Generate Messages
</Button>
</Box>
}
} ErrorsErrors``` editor evalClientHandler error Error: Module not found: Can't resolve @likissdmd/warframe-market-prime-trash-buyer at r (client-handler.js:254:11) at eval (eval at (client-handler.js:1:1), :6:24) at eval (client-handler.js:24:33) at Generator.next () at eval (client-handler.js:12:71) at new Promise () at __awaiter (client-handler.js:8:12) at evalClientHandler (client-handler.js:17:12) at eval (client-handler.js:328:122) at Generator.next () at eval (client-handler.js:75:71) at new Promise () at __awaiter (client-handler.js:71:12) at evalClientHandler (client-handler.js:327:12) at CytoEditor._e (editor.js:286:75) at commitHookEffectListMount (react-dom.development.js:23145:26) at commitPassiveMountOnFiber (react-dom.development.js:24921:13) at commitPassiveMountEffects_complete (react-dom.development.js:24886:9) at commitPassiveMountEffects_begin (react-dom.development.js:24873:7) at commitPassiveMountEffects (react-dom.development.js:24861:3) at flushPassiveEffectsImpl (react-dom.development.js:27034:3) at flushPassiveEffects (react-dom.development.js:26979:14) at performSyncWorkOnRoot (react-dom.development.js:26071:3) at flushSyncCallbacks (react-dom.development.js:12042:22) at commitRootImpl (react-dom.development.js:26954:3) at commitRoot (react-dom.development.js:26677:5) at finishConcurrentRender (react-dom.development.js:25976:9) at performConcurrentWorkOnRoot (react-dom.development.js:25804:7) at workLoop (scheduler.development.js:266:34) at flushWork (scheduler.development.js:239:14) at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:21) ```Working Client Handler Code (Importing other libraries by using await deep.import)async ({ deep, require }) => {
const React = await deep.import('react');
const { Box,Button } = await deep.import('@chakra-ui/react');
// const { generateMessages, getAllCoolOrders } = require("@likissdmd/warframe-market-prime-trash-buyer")
return ({ fillSize, style, link }) => {
return <Box
style={{ width: 300, height: 300, ...style }}
bg={'bgColor'}
color={'text'}
borderColor={'borderColor'}
borderWidth='thin'
borderWidth='1px' borderRadius='lg'
padding={1}
>
<Button>
Generate Messages
</Button>
</Box>
}
} Not Working Client Handler Code (Importing the library by using await deep.import)async ({ deep, require }) => {
const React = await deep.import('react');
const { Box,Button } = await deep.import('@chakra-ui/react');
const { generateMessages, getAllCoolOrders } = await deep.import("@likissdmd/warframe-market-prime-trash-buyer")
return ({ fillSize, style, link }) => {
return <Box
style={{ width: 300, height: 300, ...style }}
bg={'bgColor'}
color={'text'}
borderColor={'borderColor'}
borderWidth='thin'
borderWidth='1px' borderRadius='lg'
padding={1}
>
<Button>
Generate Messages
</Button>
</Box>
}
} Errors:Errors``` IGNORED ERROR: Call to DeepClient.resolveDependency is failed with Error: Module not found: Can't resolve @likissdmd/warframe-market-prime-trash-buyer at r (client-handler.js:254:11) at eval (client-handler.js:248:16) at Generator.next () at eval (client-handler.js:75:71) at new Promise () at __awaiter (client-handler.js:71:12) at _deep_foundation_deeplinks_imports_client__WEBPACK_IMPORTED_MODULE_2__.DeepClient.resolveDependency (client-handler.js:204:113) at DeepClient.eval (client.js:823:45) at Generator.next () at eval (client.js:44:71) at new Promise () at __awaiter (client.js:40:12) at DeepClient.import (client.js:820:16) at eval (eval at (client-handler.js:1:1), :6:41) at eval (client-handler.js:24:33) at Generator.next () at eval (client-handler.js:12:71) at new Promise () at __awaiter (client-handler.js:8:12) at evalClientHandler (client-handler.js:17:12) at eval (client-handler.js:328:122) at Generator.next () at eval (client-handler.js:75:71) at new Promise () at __awaiter (client-handler.js:71:12) at evalClientHandler (client-handler.js:327:12) at CytoEditor._e (editor.js:286:75) at commitHookEffectListMount (react-dom.development.js:23145:26) at commitPassiveMountOnFiber (react-dom.development.js:24921:13) at commitPassiveMountEffects_complete (react-dom.development.js:24886:9) at commitPassiveMountEffects_begin (react-dom.development.js:24873:7) at commitPassiveMountEffects (react-dom.development.js:24861:3) at flushPassiveEffectsImpl (react-dom.development.js:27034:3) at flushPassiveEffects (react-dom.development.js:26979:14) at performSyncWorkOnRoot (react-dom.development.js:26071:3) at flushSyncCallbacks (react-dom.development.js:12042:22) at commitRootImpl (react-dom.development.js:26954:3) at commitRoot (react-dom.development.js:26677:5) at finishConcurrentRender (react-dom.development.js:25976:9) at performConcurrentWorkOnRoot (react-dom.development.js:25804:7) at workLoop (scheduler.development.js:266:34) at flushWork (scheduler.development.js:239:14) at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:21) ``` |
@FreePhoenix888 use commands from this section: https://github.com/deep-foundation/dev?tab=readme-ov-file#workspaces For example:
This command should be executed in Note that |
Accodring to your answer I have checked out to main in deepcase, executed the command you provided in dev folder, but I still get the same error The package is installed:
|
I am not sure how this error happens but I created a new gitpod workspace with deep and:
Error
How is this possble? The same code cause different error in two deeps |
@Konard any updates on this? |
The same happening to another module I have used before for deep-memo:
|
@FreePhoenix888 did you able to solve this issue? If not, then what exactly left to fix? |
I should recheck it lates with exactly the same packages here |
We have added dependency this way: main...LiKissDmd:deepcase:main
Here is client handler code:
Nothing is showed in the preview. I think this is related to import. When we were trying to import this package in async docker handler (not client) we had error like "You are importing es module by using require, use async import instead (await import)) and we fixed that by using await import instead and it was working. await import here does not work
The text was updated successfully, but these errors were encountered: