ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
329 stars 96 forks source link

UI-REACT: build error #161

Closed NarekChang closed 6 months ago

NarekChang commented 6 months ago

Describe the bug

Build with non-existent files. It seems to be a conflict of npm package versions. You may not have updated some part of the public packages.

Expected behavior

No assembly error

Current behavior

WARNING in ./node_modules/@tonconnect/sdk/lib/esm/index.mjs Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/.../frontend/node_modules/@tonconnect/sdk/src/utils/types.ts' file: Error: ENOENT: no such file or directory, open '/.../frontend/node_modules/@tonconnect/sdk/src/utils/types.ts'

Steps to Reproduce

  1. npm i @tonconnect/ui-react
  2. Wrapped HOC to TonConnectUIProvider
  3. run react-scripts start

(use react-cli)

Environment

ts-config

{
  "compilerOptions": {
    "baseUrl": ".",
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "paths": {
      "features": ["./src/features"]
    },
    "typeRoots": ["./node_modules/telegram-webapps"]
  },
  "include": ["**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

Additional context

No response

Srr233 commented 1 month ago

Hello. I have the same issue here with @tonconnect/sdk

I'm using react but with @tonconnect/sdk instead ui-react.

ts config

  "compilerOptions": {
    "baseUrl": "src",
    "target": "ES2015",
    "module": "esnext",
    "lib": ["dom", "esnext"],
    "allowJs": false,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "esModuleInterop": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "strict": false,
    "sourceMap": true,
    "incremental": true
  },
  "exclude": ["node_modules", "src/**/*.css"],
  "include": ["src/**/*.tsx", "src/**/*.ts", "src/custom.d.ts"]
}

Errors

WARNING in ./node_modules/@tonconnect/sdk/lib/esm/index.mjs
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\programming\c2c-frontend\node_modules\@tonconnect\sdk\src\wallets-list-manager.ts' file: Error: ENOENT: no such file or directory, open 'D:\programming\c2c-frontend\node_modules\@tonconnect\sdk\src\wallets-list-manager.ts'

WARNING in ./node_modules/@orbs-network/ton-access/lib/index.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\programming\c2c-frontend\node_modules\@orbs-network\ton-access\src\index.ts' file: Error: ENOENT: no such file or directory, open 'D:\programming\c2c-frontend\node_modules\@orbs-network\ton-access\src\index.ts'

WARNING in ./node_modules/@orbs-network/ton-access/lib/nodes.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\programming\c2c-frontend\node_modules\@orbs-network\ton-access\src\nodes.ts' file: Error: ENOENT: no such file or directory, open 'D:\programming\c2c-frontend\node_modules\@orbs-network\ton-access\src\nodes.ts'

and so on...