surf icon indicating copy to clipboard operation
surf copied to clipboard

wip

Open 0x-j opened this issue 1 year ago • 1 comments

I'm getting this weird dependency error when running the new example scaffold using create-aptos-dapp. But when I use create-aptos-dapp with npm published surf (old version), I don't have this issue.

This is probably an error with wallet adaptor?

$ vite
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
Port 5173 is in use, trying another one...

  VITE v5.4.0  ready in 370 ms

  ➜  Local:   http://localhost:5174/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
✘ [ERROR] Could not resolve "aptos"

    node_modules/@aptos-labs/wallet-adapter-core/dist/index.mjs:5:65:
      5 │ import { TxnBuilderTypes as TxnBuilderTypes4, BCS as BCS2 } from "aptos";
        ╵                                                                  ~~~~~~~

  You can mark the path "aptos" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@mizuwallet-sdk/core"

    node_modules/@mizuwallet-sdk/aptos-wallet-adapter/dist/index.js:5:27:
      5 │ import { Mizu as hr } from "@mizuwallet-sdk/core";
        ╵                            ~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@mizuwallet-sdk/core" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "aptos"

    node_modules/@aptos-connect/wallet-adapter-plugin/dist/index.mjs:357:32:
      357 │ import { TxnBuilderTypes } from "aptos";
          ╵                                 ~~~~~~~

  You can mark the path "aptos" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "aptos"

    node_modules/@identity-connect/wallet-api/dist/index.mjs:3:20:
      3 │ import { BCS } from "aptos";
        ╵                     ~~~~~~~

  You can mark the path "aptos" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

/Users/jianyishi/go/src/github.com/0xaptosj/surf/example2/node_modules/esbuild/lib/main.js:1472
  let error = new Error(text);
              ^

Error: Build failed with 4 errors:
node_modules/@aptos-connect/wallet-adapter-plugin/dist/index.mjs:357:32: ERROR: Could not resolve "aptos"
node_modules/@aptos-labs/wallet-adapter-core/dist/index.mjs:5:65: ERROR: Could not resolve "aptos"
node_modules/@identity-connect/wallet-api/dist/index.mjs:3:20: ERROR: Could not resolve "aptos"
node_modules/@mizuwallet-sdk/aptos-wallet-adapter/dist/index.js:5:27: ERROR: Could not resolve "@mizuwallet-sdk/core"
    at failureErrorWithLog (/Users/jianyishi/go/src/github.com/0xaptosj/surf/example2/node_modules/esbuild/lib/main.js:1472:15)
    at /Users/jianyishi/go/src/github.com/0xaptosj/surf/example2/node_modules/esbuild/lib/main.js:945:25
    at /Users/jianyishi/go/src/github.com/0xaptosj/surf/example2/node_modules/esbuild/lib/main.js:1353:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}

Node.js v18.20.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

0x-j avatar Aug 12 '24 08:08 0x-j

will delete old example and rename example2 to example after i fix the error.

0x-j avatar Aug 12 '24 08:08 0x-j