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

"Error: cannot load URL protocol: c:" when attempting to use this from windows #7

Closed
mreinstein opened this issue Oct 26, 2020 · 1 comment

Comments

@mreinstein
Copy link
Collaborator

index.js:

import clamp from 'https://cdn.skypack.dev/clamp'

console.log('clamped:', clamp(100, 0, 90))

rollup.config.js:

import urlResolve from 'rollup-plugin-url-resolve'

export default {
    plugins: [
        urlResolve()
    ]
}

Output:

C:\Users\Mike\wwwroot\test-u>  npx rollup -c rollup.config.js --format es -o bundle.js index.js

[!] (plugin at position 1) Error: Could not load C:\Users\Mike\wwwroot\test-u\index.js: Cannot load URL protocol: c:
Error: Could not load C:\Users\Mike\wwwroot\test-u\index.js: Cannot load URL protocol: c:
    at loadURL (C:\Users\Mike\wwwroot\test-u\node_modules\rollup-plugin-url-resolve\cjs\rollup-plugin-url-resolve.js:148:13)
    at Object.load (C:\Users\Mike\wwwroot\test-u\node_modules\rollup-plugin-url-resolve\cjs\rollup-plugin-url-resolve.js:160:20)
    at Promise.resolve.then (C:\Users\Mike\AppData\Roaming\npm-cache\_npx\16376\node_modules\rollup\dist\shared\rollup.js:18718:25)

@mreinstein
Copy link
Collaborator Author

@mjackson have a PR for this, let me know if you'd like any changes to it. Thanks for a great module!

mreinstein added a commit that referenced this issue Jun 1, 2021
check url validity before attempting to load it. fixes #7
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