So many compile warn when using lastest @fuels/connectors

After using lastest @fuels/connectors and fuels sdk, our full-chain game is very smoothly.
But we still have to point out two hidden problems. The first one is when compiling, there are more than 500 warnings related to @fuels/connectors, similar to the following:

WARNING in ./node_modules/@web3modal/wallet/dist/esm/src/W3mFrameStorage.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\@web3modal\wallet\src\W3mFrameStorage.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\@web3modal\wallet\src\W3mFrameStorage.ts'

WARNING in ./node_modules/superstruct/dist/index.mjs
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\superstruct\src\error.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\superstruct\src\error.ts'

WARNING in ./node_modules/superstruct/dist/index.mjs
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\superstruct\src\struct.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\superstruct\src\struct.ts'

WARNING in ./node_modules/superstruct/dist/index.mjs
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\coercions.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\coercions.ts'

WARNING in ./node_modules/superstruct/dist/index.mjs
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\refinements.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\refinements.ts'

WARNING in ./node_modules/superstruct/dist/index.mjs
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\types.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\types.ts'

WARNING in ./node_modules/superstruct/dist/index.mjs
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\utilities.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\superstruct\src\structs\utilities.ts'

WARNING in ./node_modules/superstruct/dist/index.mjs
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\React\fuel_game_v2\node_modules\superstruct\src\utils.ts' file: Error: ENOENT: no such file or directory, open 'D:\React\fuel_game_v2\node_modules\superstruct\src\utils.ts'

The second problem is that when the page is refreshed multiple times, two errors will be reported. In this scenario, we used https://connectors.fuel.network/ to test, and the same error was happened.

index.mjs:7 Uncaught (in promise) Error: Method not found
    at new n (index.mjs:7:76)
    at e.<anonymous> (index.mjs:7:76)
    at index.mjs:7:76
    at Object.next (index.mjs:7:76)
    at s (index.mjs:7:76)


index.mjs:7 Uncaught (in promise) Error: Connection not established. Please call connect() first to request a connection
    at new n (index.mjs:7:76)
    at e.<anonymous> (index.mjs:7:76)
    at index.mjs:7:76
    at Object.next (index.mjs:7:76)
    at s (index.mjs:7:76)

Hey @Clara thanks for reporting the warnings, let me check the same and get back to you.

Could you confirm that you are using @fuels/connectors v0.27.1?

Also, are any of these errors blocking you?

Hi @rishabhkeshan
Yes, we using @fuels/connectors v0.27.1
At present, it seems that the connector can be used normally

1 Like

Hi @Clara

The first issue seems to be coming from a module on your specific machine related to the superstruct source map. I suspect this may be a dependency / peer dependency you are using as we don’t use it. Perhaps you should rm -rf node_modules/ and your lockfile and then re-do a npm install

The second issue seems to be related to the async nature of how the connectors are being instantiated, we’ve seen this issue in this past, I’d recommend using a synchronous instantiation of the connectors with the init method as suggested in the docs.

Hey @maschad
Thank you for your reply. We followed this and the code also had init operation at the beginning, but there are still these warnings. We tried to use @fuels/react and found that there were more problems when running. We tried to look at its source code, but found that the code repository was missing.

Hi @Clara as I had mentioned I think the warnings are unrelated to any of the fuels SDKs, have you tried upgrading superstruct ?

I can’t say for sure what is the source of your error as it looks like the sourcemaps for the bundle code is missing, thus the error cannot be transposed from the minified code. If you can share the repo for this issue that would be helpful, otherwise could you share what bundler you are using?

The @fuels/react repo can be found here

Hey @maschad
Thank you for your reply. We will open source the latest code in the future, but there are too many modifications at present, and we plan to re-modify our UI, so the compilation warning can only be postponed.