Build warnings due to imports marked as having no side effects
See original GitHub issueBug 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:
- Created a year ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
Oh, I actually thought that was something internal from
supabase-js
.submit-form-ts
doesn’t import anything fromsupabase-js
at all, it just imports other files that themselves import fromsupabase-js
Maybe it’s a SvelteKit or Vite issue