Robbie
Robbie4w ago

Import errors when importing into Jupyter

I'm seeing some weird behaviour when I try to import a module into Jupyter. A simple reproduction is:
import { unmarshall } from "npm:@aws-sdk/util-dynamodb@3.699.0";
import { DynamoDB } from "npm:@aws-sdk/client-dynamodb@3.431.0";
console.log(unmarshall);
import { unmarshall } from "npm:@aws-sdk/util-dynamodb@3.699.0";
import { DynamoDB } from "npm:@aws-sdk/client-dynamodb@3.431.0";
console.log(unmarshall);
If I run that code in Jupyter it works fine but when I move it to a file foo.ts and import that module in Jupyter...
import * as foo from "./foo.ts";
import * as foo from "./foo.ts";
I get an error:
Stack trace:
TypeError: [ERR_MODULE_NOT_FOUND] Cannot find module 'file:///Users/robbie/Library/Caches/deno/npm/registry.npmjs.org/@aws-sdk/util-dynamodb/3.699.0_1/index.js' imported from 'file:///private/tmp/foo.ts'
at async <anonymous>:4:13
Stack trace:
TypeError: [ERR_MODULE_NOT_FOUND] Cannot find module 'file:///Users/robbie/Library/Caches/deno/npm/registry.npmjs.org/@aws-sdk/util-dynamodb/3.699.0_1/index.js' imported from 'file:///private/tmp/foo.ts'
at async <anonymous>:4:13
What's strange is if I change the order of the two import lines it works... but then the error will come back if I add a 3rd import from a different @aws-sdk package. Does anyone have any idea what's going on and whether there is any workaround?
0 Replies
No replies yetBe the first to reply to this messageJoin