exports not defined
See original GitHub issueI’m getting the following error when importing from svelte-web3
exports is not defined ReferenceError: exports is not defined
Here is more detailed logs
1:04:38 PM [vite] Error when evaluating SSR module /node_modules/svelte-proxied-store/dist/store.js?v=648dcf98:
ReferenceError: exports is not defined
at eval (/node_modules/svelte-proxied-store/dist/store.js?v=648dcf98:5:23)
at instantiateModule (C:\Users\antho\Desktop\Code\Tutorials\MyDapp\node_modules\vite\dist\node\chunks\dep-76613303.js:60094:15)
1:04:38 PM [vite] Error when evaluating SSR module /node_modules/svelte-web3/src/stores.js:
ReferenceError: exports is not defined
at eval (/node_modules/svelte-proxied-store/dist/store.js?v=648dcf98:5:23)
at instantiateModule (C:\Users\antho\Desktop\Code\Tutorials\MyDapp\node_modules\vite\dist\node\chunks\dep-76613303.js:60094:15)
1:04:38 PM [vite] Error when evaluating SSR module /src/routes/index.svelte:
ReferenceError: exports is not defined
at eval (/node_modules/svelte-proxied-store/dist/store.js?v=648dcf98:5:23)
at instantiateModule (C:\Users\antho\Desktop\Code\Tutorials\MyDapp\node_modules\vite\dist\node\chunks\dep-76613303.js:60094:15)
This is when importing from a newly instantiated SvelteKit project. Here is the code in my <script> tag:
// IMPORT THESE
import { browser } from '$app/env';
import { defaultEvmStores, web3, selectedAccount, connected, chainId, chainData } from 'svelte-web3';
// This will only render client-side if the browser is available.
if(browser) {
defaultEvmStores.setBrowserProvider();
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Typescript ReferenceError: exports is not defined
I had the error "exports is not defined" coming from an imported NPM module. Changing my typescript config did nothing as I had...
Read more >How to fix ReferenceError: exports is not defined TypeScript
Solution. If you are getting the error for code that runs in the browser, try defining a global exports variable above the script...
Read more >Uncaught ReferenceError: exports is not defined : r/typescript
Getting this error for some dumb reason i'm sure. Uncaught ReferenceError: exports is not defined. at app.js:2. (anonymous) @ app.js:2. all ...
Read more >exports is not defined" in browser : WEB-26773 - YouTrack
When I compile Typescript files with IntelliJ (using "Enable typescript compiler" or clicking the Compile button), the generated js-file does not seem to ......
Read more >exports is not defined · Issue #7128 · vitejs/vite - GitHub
exports is not defined #7128 ... from '@rollup/plugin-inject' // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], ...
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 FreeTop 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
Top GitHub Comments
Please upgrade to svelte-web3 version 3.0.2 . That should solve all Vite problems… Thanks for taking the time to report the issue!
I just published it here: https://github.com/PythoniCode/MyDapp
Thanks for looking into it so quickly.