Closed zamrokk closed 1 year ago
Describe the bug I import the sdk on my React application and the webpage does not display anymore
To Reproduce
import { createMessagePayload } from "@siwt/sdk";
you got Uncaught TypeError: axios_1.default is undefined on the web page console
Uncaught TypeError: axios_1.default is undefined
Expected behavior Do not break the react bundle
Screenshots
Desktop (please complete the following information):
Additional context When I do npm run start there is no error, it is when the page refresh to fetch the React bundle
npm run start
package.json.lock
"node_modules/@ionic/react": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@ionic/react/-/react-7.0.0.tgz", "integrity": "sha512-t9NlHZTiH/NvT3GLcO4yS5Whe9stpsZ9AtNOYS+aPcKM5vhxJSFGXDUvKtABOLi2CniW2kFE8krHwjz9V0GQYA==", "dependencies": { "@ionic/core": "7.0.0", "ionicons": "^7.0.0", "tslib": "*" }, "peerDependencies": { "react": ">=16.8.6", "react-dom": ">=16.8.6" } }, ... "node_modules/react": { "version": "18.2.0", ... "node_modules/@siwt/sdk": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@siwt/sdk/-/sdk-0.0.3.tgz", "integrity": "sha512-cZDzozAJEYbMdvgRqqbULcXw2o10h34EpKn7WsH2MCArgRGIaQ0gOgPBk5JhOL3bYkgKbYi+Od86JhljcseEng==", "peerDependencies": { "@taquito/utils": "15.1.0", "axios": "1.3.3", "ramda": "0.28.0", "tslib": "2.5.0" } }, ... "node_modules/axios": { "version": "1.3.3",
npm i axios@0.27.2 --force seem to fix it
npm i axios@0.27.2 --force
Just axios is not compatible with Typescript anymore after axios v1 ...
I recommend you to set the axios version like mine to allow Typescript to be used
Thanks @zamrokk
Describe the bug I import the sdk on my React application and the webpage does not display anymore
To Reproduce
you got
Uncaught TypeError: axios_1.default is undefined
on the web page consoleExpected behavior Do not break the react bundle
Screenshots
Desktop (please complete the following information):
Additional context When I do
npm run start
there is no error, it is when the page refresh to fetch the React bundlepackage.json.lock