monkeymom2
monkeymom26mo ago

Importing submodules

Hi, I am working for the first time with deno in my supabase edge functions. I am trying to import a submodule in my import_map.json file. Currently, I have this.
{
"imports": {
"@microsoft/microsoft-graph-client": "npm:@microsoft/microsoft-graph-client@^3.0.7",
"@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials": "npm:@microsoft/microsoft-graph-client@^3.0.7/lib/src/authentication/azureTokenCredentials",
}
}
{
"imports": {
"@microsoft/microsoft-graph-client": "npm:@microsoft/microsoft-graph-client@^3.0.7",
"@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials": "npm:@microsoft/microsoft-graph-client@^3.0.7/lib/src/authentication/azureTokenCredentials",
}
}
. I am trying to import these statements like so but am getting an error. What am I doing incorrectly?
import { Client } from "@microsoft/microsoft-graph-client";
import { TokenCredentialAuthenticationProvider } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials";
import { Client } from "@microsoft/microsoft-graph-client";
import { TokenCredentialAuthenticationProvider } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials";
2 Replies
crowlKats
crowlKats6mo ago
what is the error?
monkeymom2
monkeymom26mo ago
I get this error message:
Setting up Edge Functions runtime...
Serving functions on http://127.0.0.1:54321/functions/v1/<function-name>
serving the request with /home/deno/functions/sync-calendars-availability
Unable to load /tmp/sb-compile-edge-runtime/node_modules/localhost/@microsoft/microsoft-graph-client/3.0.7/lib/src/authentication/azureTokenCredentials imported from file:///home/deno/functions/_shared/graph.ts
An error has occured
InvalidWorkerCreation: worker boot error
at async UserWorker.create (ext:sb_user_workers/user_workers.js:123:15)
at async Server.<anonymous> (file:///home/deno/main/index.ts:129:20)
at async #respond (https://deno.land/std@0.182.0/http/server.ts:220:18) {
name: "InvalidWorkerCreation"
Setting up Edge Functions runtime...
Serving functions on http://127.0.0.1:54321/functions/v1/<function-name>
serving the request with /home/deno/functions/sync-calendars-availability
Unable to load /tmp/sb-compile-edge-runtime/node_modules/localhost/@microsoft/microsoft-graph-client/3.0.7/lib/src/authentication/azureTokenCredentials imported from file:///home/deno/functions/_shared/graph.ts
An error has occured
InvalidWorkerCreation: worker boot error
at async UserWorker.create (ext:sb_user_workers/user_workers.js:123:15)
at async Server.<anonymous> (file:///home/deno/main/index.ts:129:20)
at async #respond (https://deno.land/std@0.182.0/http/server.ts:220:18) {
name: "InvalidWorkerCreation"
i am trying to port this code from node
import { Client } from "@microsoft/microsoft-graph-client";
import { TokenCredentialAuthenticationProvider } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials";
import { Client } from "@microsoft/microsoft-graph-client";
import { TokenCredentialAuthenticationProvider } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials";