Skip to content
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

[Deno] Error While Installing /functions Package #834

Closed
aunyks opened this issue Feb 24, 2023 · 5 comments
Closed

[Deno] Error While Installing /functions Package #834

aunyks opened this issue Feb 24, 2023 · 5 comments
Labels
bug Something isn't working external Problems or limitations traced back to other tools.

Comments

@aunyks
Copy link

aunyks commented Feb 24, 2023

Describe the bug
When running a Deno script that imports @gltf-transform/functions via https://esm.sh/@gltf-transform/functions, a 500 HTTP response is returned when it tries to install https://esm.sh/v107/ndarray-lanczos@0.2.0/deno/ndarray-lanczos.js.

The error is:

/* esm.sh - error */
throw new Error("[esm.sh] " + "resovleESModule: open /tmp/esm-build-a5562132cd84dbc9fc7056377a6f582714f47852-3a3152a6/node_modules/ndarray-lanczos/dist/ndarray-lanczos.modern.js: no such file or directory");
export default null;

I suspect this is related to the build configuration of donmccurdy/ndarray-lanczos.

Steps To Reproduce

  1. Create a file error-test.js with this as the only line: import * as f from 'https://esm.sh/@gltf-transform/functions'
  2. Run deno run --allow-net error-test.js

Expected behavior
An error-free install and script execution.

Versions:

  • Deno: 1.25.0
  • gltf-transform: 3.0.3
@aunyks aunyks added the bug Something isn't working label Feb 24, 2023
@aunyks aunyks changed the title ES Module Build Error While Installing /functions Package [Deno] ES Module Build Error While Installing /functions Package Feb 24, 2023
@aunyks aunyks changed the title [Deno] ES Module Build Error While Installing /functions Package [Deno] Error While Installing /functions Package Feb 24, 2023
@donmccurdy
Copy link
Owner

Unfortunately there are a number of obstacles. I'd like to support Deno, but in practice it's pretty complicated. Certain decisions by the TypeScript team, and the difficulty of running the unit tests in multiple environments, have been obstacles. See #457.

I'll take a look at the ndarray issues, those may be simple enough to fix:

But I'm not sure Deno will 'just work' even with those issues resolved. If you'd be up for doing some more investigation here, that'd be very welcome -- thanks!

@donmccurdy donmccurdy added this to the Backlog milestone Feb 24, 2023
@donmccurdy donmccurdy added the external Problems or limitations traced back to other tools. label Feb 24, 2023
@donmccurdy
Copy link
Owner

Possible fix, at least for the ndarray-related part of the problem:

@aunyks
Copy link
Author

aunyks commented Feb 24, 2023

Understood, if #835 doesn't fix this then I'll see if I can look into it some more. Thanks for the quick response anyway!

@donmccurdy
Copy link
Owner

Published v3.0.4 — Haven't tested thoroughly, but this much seems to work:

import { Document, DenoIO } from 'https://esm.sh/@gltf-transform/core';
import { KHRONOS_EXTENSIONS } from 'https://esm.sh/@gltf-transform/extensions';
import { dedup } from 'https://esm.sh/@gltf-transform/functions';

const io = new DenoIO().registerExtensions(KHRONOS_EXTENSIONS);
const document = new Document();

console.log(document);

@aunyks
Copy link
Author

aunyks commented Feb 26, 2023

Works for me as well! Thanks for addressing.

@aunyks aunyks closed this as completed Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Problems or limitations traced back to other tools.
Projects
None yet
Development

No branches or pull requests

2 participants