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

"Writable" is not exported by "__vite-browser-external" #4414

Closed
peterpeterparker opened this issue Apr 8, 2024 · 3 comments · Fixed by WalletConnect/walletconnect-utils#167 or #4426
Assignees
Labels
Customer Support type: bug Something isn't working

Comments

@peterpeterparker
Copy link

peterpeterparker commented Apr 8, 2024

Describe the bug

Migrating @walletconnect/web3wallet from 1.10.2 to 1.11.1 in our project leads to following npm run build error:

x Build failed in 9.44s
x Build failed in 12.02s
error during build:
RollupError: [vite-plugin-sveltekit-compile] node_modules/@walletconnect/core/node_modules/@walletconnect/logger/dist/index.es.js (1:132): "Writable" is not exported by "__vite-browser-external", imported by "node_modules/@walletconnect/core/node_modules/@walletconnect/logger/dist/index.es.js".
file: /Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/@walletconnect/core/node_modules/@walletconnect/logger/dist/index.es.js:1:132
1: import h,{levels as i}from"pino";import{default as D}from"pino";import{safeJsonStringify as u}from"@walletconnect/safe-json";import{Writable a...
                                                                                                                                       ^
2: //# sourceMappingURL=index.es.js.map
file: /Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/@walletconnect/core/node_modules/@walletconnect/logger/dist/index.es.js:1:132
1: import h,{levels as i}from"pino";import{default as D}from"pino";import{safeJsonStringify as u}from"@walletconnect/safe-json";import{Writable a...
                                                                                                                                       ^
2: //# sourceMappingURL=index.es.js.map
    at getRollupError (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/parseAst.js:392:41)
    at error (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/parseAst.js:388:42)
    at Module.error (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:13688:16)
    at Module.traceVariable (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:14136:29)
    at ModuleScope.findVariable (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:11817:39)
    at ChildScope.findVariable (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:6037:38)
    at Identifier.bind (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:7311:40)
    at ClassDeclaration.bind (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:4753:23)
    at Program.bind (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:4749:28)
    at Module.bindReferences (file:///Users/daviddalbusco/projects/dfinity/oisy-wallet/node_modules/rollup/dist/es/shared/node-entry.js:13669:18)

To Reproduce

Create an empty SvelteKit / Vite project and just import walletconnect Core.

<script lang="ts">
    import { Core } from '@walletconnect/core';

    console.log(Core); // <---- Reproduce the issue
</script>

<h1>Demo</h1>

Steps to reproduce the behavior:

  1. git clone https://github.com/peterpeterparker/walletconnect_1-11-1
  2. cd walletconnect_1-11-1
  3. npm ci
  4. npm run build

Expected behavior
No build error.

Screenshots

Capture d’écran 2024-04-08 à 07 03 01

@peterpeterparker peterpeterparker added the type: bug Something isn't working label Apr 8, 2024
Copy link

linear bot commented Apr 8, 2024

@devceline
Copy link
Contributor

Thank you for the fantastic repro case - helped expedite solve this. Fix is in this PR here and in progress WalletConnect/walletconnect-utils#167

@peterpeterparker
Copy link
Author

Thanks for the quick fix @devceline! I can confirm that the released patch of @walletconnect/logger fixes the issue in our project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Support type: bug Something isn't working
Projects
None yet
2 participants