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

Line must be greater than or equal to 1, got -1 #10

Closed
SorenHolstHansen opened this issue Nov 14, 2021 · 3 comments
Closed

Line must be greater than or equal to 1, got -1 #10

SorenHolstHansen opened this issue Nov 14, 2021 · 3 comments

Comments

@SorenHolstHansen
Copy link

I tried running the repo, but got

Line must be greater than or equal to 1, got -1

TypeError: Line must be greater than or equal to 1, got -1
    at BasicSourceMapConsumer.SourceMapConsumer_findMapping [as _findMapping] (/Users/.../sveltekit-example/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:65405:13)
    at BasicSourceMapConsumer.SourceMapConsumer_originalPositionFor [as originalPositionFor] (/Users/.../sveltekit-example/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:65474:22)
    at /Users/.../sveltekit-example/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66413:34
    at String.replace (<anonymous>)
    at /Users/.../sveltekit-example/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66403:21
    at Array.map (<anonymous>)
    at ssrRewriteStacktrace (/Users/.../sveltekit-example/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66402:10)
    at instantiateModule (/Users/.../sveltekit-example/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66547:28)

I am using yarn, if that makes a difference

@CaptainCodeman
Copy link
Owner

I think there are still issues with the Firebase 9 SDK - if you pin it to the 9.0.0 version it works.

@SorenHolstHansen
Copy link
Author

That worked, thanks!

@dnotes
Copy link

dnotes commented Nov 16, 2021

I had this same issue, which brought me here. I later found Ben McCann's comment in the Firebase SDK queue. Adding the suggested config to svelte.config.js seems to solve the problems with firebase/auth. PR seems hardly worth the trouble but I think this is the workaround for now.

diff --git a/svelte.config.js b/svelte.config.js
index da8701d..29f7dff 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -19,6 +19,9 @@ const config = {
                target: '#svelte',
 
                vite: {
+      ssr: {
+        external: ['whatwg-url', 'node-fetch']
+      },
                        build: {
                                sourcemap: true,
                        },

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

3 participants