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

Fix first time download #10

Merged
merged 3 commits into from
Apr 7, 2019
Merged

Fix first time download #10

merged 3 commits into from
Apr 7, 2019

Conversation

c4software
Copy link
Contributor

Hi,

With Rollup.js i wasn't able to « import "https://…" » i notice « Url is undefined » (line https://github.com/egoist/import-http/blob/master/lib/rollup.js#L57) when the targeted library isn't in the cache.

Since the URL is also the key its solve the problem.

OS: MacOS
NodeJS Version : 11.13.0
Bundler : RollupJS
Original log :

$ rollup -c

src/main.js → dist/bundle.js...
Downloading undefined...
[!] Error: Could not load https://cdn.jsdelivr.net/npm/vue/dist/vue.esm.browser.js (imported by /Users/valentinbrosseau/dev/vue-yasb/src/main.js): Only absolute URLs are supported
Error: Could not load https://cdn.jsdelivr.net/npm/vue/dist/vue.esm.browser.js (imported by /Users/valentinbrosseau/dev/vue-yasb/src/main.js): Only absolute URLs are supported
    at /usr/local/lib/node_modules/rollup/dist/rollup.js:17855:19
    at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:52:5)
    at Function.Module.runMain (internal/modules/cjs/loader.js:871:11)
    at internal/main/run_main_module.js:21:11

Hi,

With Rollup.js i wasn't able to « import "https://…" » i notice « Url is undefined » (line https://github.com/egoist/import-http/blob/master/lib/rollup.js#L57) when the targeted library isn't in the cache.

Since the URL is also the key its solve the problem.

OS: MacOS
NodeJS Version : 11.13.0
Bundler : RollupJS
Original log : 

```sh
$ rollup -c

src/main.js → dist/bundle.js...
Downloading undefined...
[!] Error: Could not load https://cdn.jsdelivr.net/npm/vue/dist/vue.esm.browser.js (imported by /Users/valentinbrosseau/dev/vue-yasb/src/main.js): Only absolute URLs are supported
Error: Could not load https://cdn.jsdelivr.net/npm/vue/dist/vue.esm.browser.js (imported by /Users/valentinbrosseau/dev/vue-yasb/src/main.js): Only absolute URLs are supported
    at /usr/local/lib/node_modules/rollup/dist/rollup.js:17855:19
    at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:52:5)
    at Function.Module.runMain (internal/modules/cjs/loader.js:871:11)
    at internal/main/run_main_module.js:21:11
```
@egoist
Copy link
Owner

egoist commented Apr 7, 2019

let's change url to id here instead

const res = await fetch(url)

Since URL is undefined the first time (file not present in cache).
@egoist egoist merged commit 8de9ae9 into egoist:master Apr 7, 2019
@egoist
Copy link
Owner

egoist commented Apr 7, 2019

🎉 This PR is included in version 0.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@egoist egoist added the released label Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants