Open tylerbutler opened 3 years ago
@SamBroner FYI.
Just to add when using deno import * as jira from "https://cdn.skypack.dev/jira.js@v2.14.0";
also explodes on the same punycode package with ;
deno run --allow-net --allow-env ./src/main.ts
Check file:///home/jack.bennett/TargetJIRA/src/main.ts
error: Uncaught Error: [Package Error] "punycode" does not exist. (Imported by "atlassian-jwt").
throw new Error("[Package Error] \"punycode\" does not exist. (Imported by \"atlassian-jwt\").");
^
at https://cdn.skypack.dev/error/node:punycode?from=atlassian-jwt:14:7
punycode is in deno/std/node so I tried an import-map but same error
{
"imports": {
"punycode": "https://deno.land/std@0.140.0/node/punycode.ts"
}
}
deno run --allow-net --allow-env --import-map ./import_map.json ./src/main.ts
error: Uncaught Error: [Package Error] "punycode" does not exist. (Imported by "atlassian-jwt").
throw new Error("[Package Error] \"punycode\" does not exist. (Imported by \"atlassian-jwt\").");
^
at https://cdn.skypack.dev/error/node:punycode?from=atlassian-jwt:14:7
I have the same issue right now with node-html-to-image
import * as nodeHtmlToImage from "https://cdn.skypack.dev/node-html-to-image";
nodeHtmlToImage({
output: './image.png',
html: '<html><body>Hello world!</body></html>'
})
.then(() => console.log('The image was created successfully!'))
error: Uncaught Error: [Package Error] "punycode" does not exist. (Imported by "puppeteer-cluster").
throw new Error("[Package Error] \"punycode\" does not exist. (Imported by \"puppeteer-cluster\").");
^
at https://cdn.skypack.dev/error/node:punycode?from=puppeteer-cluster:14:7
Feb 2024 and I'm still finding this issue, trying to load fluid-framework from Skypack. Here's another twist: if I search for punycode on the Skypack home page I get a server error ("This serverless function has crashed"). But if I Google "skypack punycode", I get a hit! https://www.skypack.dev/view/punycode
So is this some kind of dependency cache corruption, or is the package really missing? How can we use packages with this dependency?
Caveat: I'm not sure this is a problem with Skypack. I think it's much more likely that we have a problem with our packages. But I'm not sure where to start debugging so I'm hoping you can help.
I'm trying to use some of the Fluid Framework packages in Deno, and Skypack seems to be a great fit. We publish ESModules for all of our packages, everything is in TypeScript, and everything can run in a browser. We do have shared code between client and server but we have isomorphic wrappers where needed.
That said, we do have some dependencies on node libraries that are polyfilled in Deno, like events, and we have dev dependencies that use Node APIs. It's one of those dev dependencies that seems to be causing issues.
For example, when I use these two Skypack URLs:
When I run in Deno, I get the following error:
The @fluidframework/driver-utils package does not directly depend on punycode, but according to
npm explain punycode
, it's a leaf dependency coming from dev packages:Is there a way to get Skypack to ignore dev dependencies, or is that on the Deno side (in which case the question probably doesn't make sense)?
I've tried other packages and combinations while experimenting, which yielded this different error message:
Is there a way to get more info on what exactly isn't getting built and why? Can I try to repro locally? Again, I'm sure this is a problem with our packages, but I don't know how to go about fixing them.