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

Some runs fail: error: Expected a JavaScript or TypeScript module #67

Closed
weirdyang opened this issue Jan 24, 2022 · 12 comments
Closed

Some runs fail: error: Expected a JavaScript or TypeScript module #67

weirdyang opened this issue Jan 24, 2022 · 12 comments

Comments

@weirdyang
Copy link

Error: Command failed: NO_COLOR=true deno run -q --allow-read --allow-write --allow-run --allow-net --allow-env --unstable post-process.js data.json
Warning Implicitly using latest version (1.0.0) for https://deno.land/x/url_join/mod.ts
error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
  Specifier: https://jspm.dev/npm:xlsx@0.17.5!cjs
    at https://jspm.dev/xlsx:5:25

I’m running a GitHub action to download images from an api every hour, I used the nasa image example as the template. However sometimes the run fails with this error, what could be the issue?

here’s the failed run:
https://github.com/weirdyang/causeway-image/actions/runs/1737018565
Here’s my post process script
https://github.com/weirdyang/causeway-image/blob/main/post-process.js

@irealva
Copy link
Contributor

irealva commented Jan 24, 2022

Hi there! Thanks for reporting this. Could you try upgrading your version of the postprocessing library to 0.0.13

So here: https://github.com/weirdyang/causeway-image/blob/main/post-process.js#L4

import { readImageFromURL, readJSON, writeImage } from 'https://deno.land/x/flat@0.0.13/mod.ts';

And let us know if the error still happens for you?

weirdyang added a commit to weirdyang/causeway-image that referenced this issue Jan 25, 2022
@weirdyang
Copy link
Author

@dalanmiller
Copy link

dalanmiller commented Jan 30, 2022

Happening to me as well! Also on 0.0.13

https://github.com/dalanmiller/electricity/blob/master/postprocess.ts#L71

https://github.com/dalanmiller/electricity/runs/4999257723

@Wattenberger
Copy link
Contributor

I did some digging here - looks like these errors are very intermittent and fail while downloading different modules required for the xlsx import from jspm.

For example, this Action fails on https://jspm.dev/npm:@jspm/core@2/nodelibs/process
https://github.com/weirdyang/causeway-image/runs/4997125928?check_suite_focus=true

but this Action fails on https://jspm.dev/npm:@jspm/core@2/nodelibs/buffer
https://github.com/weirdyang/causeway-image/runs/4998890994?check_suite_focus=true

One other thing I noticed is that the errors appear to start ~Jan 10th, looking through the history on your repo, @dalanmiller. Looks like there was an xlsx release around the same time:

image

I pinned the xlsx import to v0.17.4
https://deno.land/x/flat@0.0.14/src/xlsx.ts#L1

I'm not positive that this will fix the error, but it might! Try bumping your flat import to 0.0.14, and we can revisit if the errors are still showing up.

@dalanmiller
Copy link

dalanmiller commented Feb 1, 2022

Thanks for investigating @Wattenberger - I bumped to 0.0.14 and I'm still getting the same issue it seems.

Has anything changed to the Deno runtime behind the scenes?

https://github.com/dalanmiller/electricity/actions/runs/1775755781

Edit:

But oddly, it's intermittent, this recent run succeeded:
https://github.com/dalanmiller/electricity/runs/5015504616?check_suite_focus=true

@weirdyang
Copy link
Author

weirdyang commented Feb 1, 2022

Thanks, will try and report back. Fwiw I noticed the examples are also failing intermittently https://github.com/githubocto/flat-demo-bitcoin-price/actions/runs/1778265780

@irealva
Copy link
Contributor

irealva commented Feb 11, 2022

Thanks, will try and report back. Fwiw I noticed the examples are also failing intermittently https://github.com/githubocto/flat-demo-bitcoin-price/actions/runs/1778265780

This might have been because we hadn't updated the flat-demo-bitcoin-price to use 0.0.14 but we just did to see what happens.

@irealva
Copy link
Contributor

irealva commented Feb 11, 2022

Following-up @dalanmiller it doesn't seem like your action has failed in a while, is that correct ?https://github.com/dalanmiller/electricity/actions?

@irealva
Copy link
Contributor

irealva commented Feb 11, 2022

Also will leave a comment to follow this issue which Amelia found: SheetJS/sheetjs#2217

@weirdyang
Copy link
Author

Just bumped to 14, fwiw didn’t get any errors the past few days with 13

andmos added a commit to andmos/ReadingList-Data that referenced this issue Feb 14, 2022
@andmos
Copy link
Contributor

andmos commented Feb 14, 2022

I had the some error all of a sudden, looks like a bump to 0.0.14 did the trick.

@Wattenberger
Copy link
Contributor

Thanks for the reports y'all! Looks like runs have stopped intermittently failing 🙌 Please let us know if it starts happening again, and hopefully we can stop using jsnpm for Sheetjs soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants