sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7.01k stars 435 forks source link

Failed to resolve module specifier. Cannot import modules properly -- IMPORTANT ! #1773

Closed codewithpatelo closed 3 years ago

codewithpatelo commented 3 years ago

NOTE: All development is currently focused on Sapper's successor, SvelteKit: https://kit.svelte.dev/ While we might fix some particularly pressing or easy to address bugs, it's highly unlikely that most issues filed here will be addressed. You might consider trying out SvelteKit to see if it is free of the issue you're facing and if not filing the issue there instead.

Describe the bug I want to use arangojs module (ArangoDB driver) but Sapper keeps confusing paths. The only log I receive is

"Failed to resolve module specifier "url". Relative references must start with either "/", "./", or "../".

TypeError: Failed to resolve module specifier "url". Relative references must start with either "/", "./", or "../".

No more information than that.

I have rollup json and rollup resolve in my rollup config files but still not working.

Logs "Failed to resolve module specifier "url". Relative references must start with either "/", "./", or "../".

TypeError: Failed to resolve module specifier "url". Relative references must start with either "/", "./", or "../".

To Reproduce Use any sapper template repo and then try importing arangojs driver.

Expected behavior Imports donde correctly

Information about your Sapper Installation:

Severity How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Sapper entirely?

The app cannot function with this bug at all since the error breaks the whole application.

Additional context Add any other context about the problem here.

Conduitry commented 3 years ago

The url Node module is not available in browsers, and it sounds like you're trying to use something that has Node dependencies in the browser, which won't work.

GitHub issues aren't the right place for support questions like this. Please ask on StackOverflow or in our Discord chat room.