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

Unable to install some scripts in version 1.4.0 #7455

Closed
oscarotero opened this issue Sep 13, 2020 · 6 comments
Closed

Unable to install some scripts in version 1.4.0 #7455

oscarotero opened this issue Sep 13, 2020 · 6 comments
Labels
bug Something isn't working correctly

Comments

@oscarotero
Copy link
Contributor

Hi, I just upgraded to the latest version and am having some problems installing libraries.

I'm working on this static site generator: https://deno.land/x/lume@v0.2.2

I've a downgrade to 1.3.3 and the library is installed and work fine:

$ deno upgrade --version 1.3.3
$ deno install -f --unstable --allow-read --allow-write --allow-net https://deno.land/x/lume@v0.2.2/cli.js
$ lume

#Site build successfully

But after upgrade to 1.4.0:

$ deno upgrade --version 1.4.0
$ deno install -f --unstable --allow-read --allow-write --allow-net https://deno.land/x/lume@v0.2.2/cli.js
$ lume

error: Uncaught TypeError: Cannot read property 'default' of undefined
export default __exp["default"];
                    ^
    at file:///Users/oscarotero/.deno/bin/lume.js:47172:21

The library works fine if it's executed locally, without install it (with deno run --unstable --allow-read --allow-write --allow-net cli.js), but it's failing on install. And because in the new version, the code is bundled before installation, I cannot know what is the source's filename and line that is failing.

@lucacasonato
Copy link
Member

lucacasonato commented Sep 13, 2020

This issue seems to be caused by the bundling:

~ ❯❯❯ deno bundle --unstable https://deno.land/x/lume@v0.2.2/cli.js > luma.js
Bundle https://deno.land/x/lume@v0.2.2/cli.js
~ ❯❯❯ deno run --unstable luma.js 
error: Uncaught TypeError: Cannot read property 'default' of undefined
export default __exp["default"];
                    ^
    at file:///home/lucacasonato/luma.js:47172:21

@kitsonk do we not emit source maps for bundles?

@lucacasonato lucacasonato added the bug Something isn't working correctly label Sep 13, 2020
@kitsonk
Copy link
Contributor

kitsonk commented Sep 13, 2020

@lucacasonato no, see: #4499 and #4549. #7225 should address this though.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 13, 2020

I realise having install do a bundle sounds great, but in retrospect, there are quite a few scenarios we can't/don't support with bundling at the moment. I am not sure it is viable, or it needs to be an option on deno install instead of it being forced.

@oscarotero
Copy link
Contributor Author

Having an option would be great. Like deno install --bundle {url}

@bartlomieju
Copy link
Member

This problem must have been caused by #5276. I expected it might have broken some code but we decided to land it anyway. I guess we'll have to revert this functionality until bundling is finished.

@oscarotero
Copy link
Contributor Author

This problem has been fixed in 1.4.1, so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants