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

Remote URL is fetched anyway if saveRemote is false #312

Open
mvastola opened this issue Jul 22, 2023 · 0 comments
Open

Remote URL is fetched anyway if saveRemote is false #312

mvastola opened this issue Jul 22, 2023 · 0 comments

Comments

@mvastola
Copy link

I'm running into an issue where a remote URL that I don't want saved is being fetched despite saveRemote being false.

It looks like this might have been intentional, but I'm not sure I understand why.

if (source.isRemote) {
// node-fetch is esm-only, so support cjs via import()
const fetch = (await import('node-fetch')).default;
const res = await fetch(/** @type { string } */ (source.sourcepath));
if (!res.ok) {
throw Error(
res.status === 404 ? 'Not found' : `Fetch error: ${res.status}`,
);
}

In my case, this is causing the entire operation to error out because the URL isn't accessible from the build machine where I run inline-source.

Is there any way to change this?

Or at least not bail when the request fails?

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

1 participant