question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build warnings due to imports marked as having no side effects

See original GitHub issue

Bug report

Describe the bug

When building my app, I get 10 warnings like this originating from supabase-js:

03:48:54.139 | ▲ [WARNING] Ignoring this import because "node_modules/@supabase/supabase-js/dist/main/index.js" was marked as having no side effects
03:48:54.139 |  
03:48:54.139 | .svelte-kit/output/server/entries/endpoints/api/submit-form.ts.js:2:7:
03:48:54.139 | 2 │ import "@supabase/supabase-js";
03:48:54.139 | ╵        ~~~~~~~~~~~~~~~~~~~~~~~
03:48:54.139 |  
03:48:54.140 | "sideEffects" is false in the enclosing "package.json" file
03:48:54.140 |  
03:48:54.140 | node_modules/@supabase/supabase-js/package.json:21:2:
03:48:54.140 | 21 │   "sideEffects": false,
03:48:54.140 | ╵   ~~~~~~~~~~~~~

I’m sure there are good reasons for it being like this, but hopefully these can be avoided.

To Reproduce

Build a SvelteKit site that imports supabase-js

Expected behavior

Would ideally expect have no warnings

System information

  • Version of supabase-js: 1.35.3
  • Version of Node.js: 16.13.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
soedirgocommented, Jul 5, 2022

@iksaku so I guess this is a SvelteKit issue? Looks like it’s tracked on https://github.com/sveltejs/kit/issues/4644, so closing this issue.

1reaction
probablykaspercommented, May 17, 2022

Oh, I actually thought that was something internal from supabase-js. submit-form-ts doesn’t import anything from supabase-js at all, it just imports other files that themselves import from supabase-js

Maybe it’s a SvelteKit or Vite issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Warnings of unused imports when packaging libs
Type imports will be erased at build time because they have no effect on the runtime of the code. That means the generated...
Read more >
API - esbuild
If you want to conditionally import a file only if the export is actually used, you should mark the injected file as not...
Read more >
Everything you never wanted to know about side effects
In this blog post I'll explain what side effects are, why webpack needs to know about them, and what it does with this...
Read more >
Compiler Warnings by compiler version | Microsoft Learn
Table of Microsoft C/C++ compiler warnings by compiler version. ... operator before comma has no effect; expected operator with side-effect.
Read more >
Warning Options - Using the GNU Compiler Collection (GCC)
Each of these specific warning options also has a negative form beginning ... marked as requiring a non-null value by the nonnull function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found