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

Unable to import stellar-sdk into React Project (Module Warning: Failed to parse source map...) #732

Open
tankh99 opened this issue Jan 8, 2022 · 9 comments
Labels

Comments

@tankh99
Copy link

tankh99 commented Jan 8, 2022

Describe the bug
Unable to import stellar-sdk into React Project. This happened after I upgraded create-react-app to 5.0.

What version are you on?
stellar-sdk ^9.1.0

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest version of create-react-app (>5.0)
  2. Create a react app and import stellar-sdk anywhere on the project

I've confirmed that this is a stellar-sdk-specific issue as once I commented out the import stellar-sdk line, the website works as expected

Expected behavior
The website runs without any issues.

Additional context
There are no additional libraries installed, just stellar-sdk. The terminal output is as follows.

WARNING in ./node_modules/stellar-sdk/lib/account_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/account_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/account_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 26:29-62
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/account_response.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/account_response.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/account_response.ts'
@ ./node_modules/stellar-sdk/lib/index.js 20:21-50
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/assets_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/assets_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/assets_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 30:28-60
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 20:21-46
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/claimable_balances_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/claimable_balances_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/claimable_balances_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 32:40-84
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/config.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/config.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/config.ts'
@ ./node_modules/stellar-sdk/lib/index.js 24:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/effect_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/effect_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/effect_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 34:28-60
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/errors.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/errors.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/errors.ts'
@ ./node_modules/stellar-sdk/lib/index.js 22:21-40
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/federation_server.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/federation_server.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/federation_server.ts'
@ ./node_modules/stellar-sdk/lib/index.js 42:26-56
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/friendbot_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/friendbot_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/friendbot_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 36:26-56
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/horizon_api.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/horizon_api.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/horizon_api.ts'
@ ./node_modules/stellar-sdk/lib/index.js 16:21-45
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/horizon_axios_client.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/horizon_axios_client.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/horizon_axios_client.ts'
@ ./node_modules/stellar-sdk/lib/index.js 72:29-62
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/index.ts'
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/ledger_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/ledger_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/ledger_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 38:28-60
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/liquidity_pool_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/liquidity_pool_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/liquidity_pool_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 40:36-76
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/offer_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/offer_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/offer_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 42:27-58
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/operation_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/operation_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/operation_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 44:31-66
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/orderbook_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/orderbook_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/orderbook_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 46:31-66
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/payment_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/payment_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/payment_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 48:29-62
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/server.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/server.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/server.ts'
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/server_api.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/server_api.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/server_api.ts'
@ ./node_modules/stellar-sdk/lib/index.js 18:21-44
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/stellar_toml_resolver.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/stellar_toml_resolver.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/stellar_toml_resolver.ts'
@ ./node_modules/stellar-sdk/lib/index.js 57:30-64
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/strict_receive_path_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/strict_receive_path_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/strict_receive_path_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 50:41-86
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/strict_send_path_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/strict_send_path_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/strict_send_path_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 52:38-80
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/trade_aggregation_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/trade_aggregation_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/trade_aggregation_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 54:39-82
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/trades_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/trades_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/trades_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 56:28-60
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/transaction_call_builder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/transaction_call_builder.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/transaction_call_builder.ts'
@ ./node_modules/stellar-sdk/lib/server.js 58:33-70
@ ./node_modules/stellar-sdk/lib/index.js 33:15-34
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/stellar-sdk/lib/utils.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/utils.ts' file: Error: ENOENT: no such file or directory, open '/Users/test-user/Documents/VSCodeProjects/Blockchain Lesson/blockchain-final/stellar-quest/node_modules/stellar-sdk/src/utils.ts'
@ ./node_modules/stellar-sdk/lib/index.js 93:21-39
@ ./src/components/quest-1.js 5:0-37
@ ./src/App.js 6:0-42 12:35-41
@ ./src/index.js 7:0-24 11:33-36

Is this happening to anybody else, or is it just me?

@tankh99 tankh99 added the bug label Jan 8, 2022
@Shaptic
Copy link
Contributor

Shaptic commented Jan 18, 2022

This is odd: I can't figure out where the source map loader tries to find these. The problem is that it's looking in the src/ folder, but the files are actually in the dist/ folder...

These are just warnings, though, and shouldn't affect neither builds nor development (i.e. I can still npm start and tinker with the web page); is that accurate for you?

@tankh99
Copy link
Author

tankh99 commented Jan 20, 2022

Hi Shaptic, unfortunately it's not just warnings, but errors. I've attached a screenshot of the errors I faced.
Screenshot 2022-01-20 at 2 15 38 PM

This was on a completely fresh react project, just by importing StellarSdk inside App.js. I haven't made any changes to the directory either

Any ideas on this?

@Leonelmarianog
Copy link

Hi Shaptic, unfortunately it's not just warnings, but errors. I've attached a screenshot of the errors I faced. Screenshot 2022-01-20 at 2 15 38 PM

This was on a completely fresh react project, just by importing StellarSdk inside App.js. I haven't made any changes to the directory either

Any ideas on this?

Any updates on a fix? This happens because Webpack 5 doesn't include any polyfills for node modules anymore.

@taamtera
Copy link

i have the same errors!
image

@Leonelmarianog
Copy link

Ok found a solution that fixed my problems for now, I used react-app-rewire to extend the webpack config and polyfill the required node modules myself. The CRA team will not polyfill them anymore since "they don't belong to the front".

@taamtera
Copy link

taamtera commented Mar 17, 2022

Ok found a solution that fixed my problems for now, I used react-app-rewire to extend the webpack config and polyfill the required node modules myself. The CRA team will not polyfill them anymore since "they don't belong to the front".

what did you chang in the webpack config in config-overrides.js? nothing i put there seems to fix this issue does it support webpack 5? or am i using the config override wrong?

edit: i was running react inside ionic which did not change the start script from react-script to react-app-rewired,
solution: npm run instead of ionic serve

@Leonelmarianog
Copy link

Leonelmarianog commented Mar 17, 2022

Ok found a solution that fixed my problems for now, I used react-app-rewire to extend the webpack config and polyfill the required node modules myself. The CRA team will not polyfill them anymore since "they don't belong to the front".

what did you chang in the webpack config in config-overrides.js? nothing i put there seems to fix this issue does it support webpack 5? or am i using the config override wrong?

edit: i was running react inside ionic which did not change the start script from react-script to react-app-rewired, solution: npm run instead of ionic serve

Nice I'm glad it helped. If you're still wondering, this is my config right now:

// config-overrides.js (at the root of the project)

const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");

module.exports = function override(config, env) {
  config.plugins.push(new NodePolyfillPlugin());
  return config;
};

@hanseartic
Copy link

hanseartic commented Apr 6, 2022

Ok found a solution that fixed my problems for now, I used react-app-rewire to extend the webpack config and polyfill the required node modules myself. The CRA team will not polyfill them anymore since "they don't belong to the front".

You may also use craco, which was suggested in CRA repo's issue-section a few times. I've compiled a gist with the necessary changes:

Still it's not a stellar-sdk issue but a webpack / CRA issue. So I suggest to close this bug-issue here.

@BenRacicot
Copy link

BenRacicot commented May 26, 2022

The Stellar SDK team may choose to leave this open since it means:

  1. The SDK doesn't support Webpack 5
    (since several deps are no longer included in WP comp, eg. EventSource, the SDK breaks within modern app frameworks)

  2. The SDK is relying on back-end tooling for front-end clients. Exciting opportunity for improvement here!
    Webpack removed these packages for a good reason, backend libs aren't meant for front-end clients. I'm willing to help create a best-path forward if the core team will guide me and show their backing.

  3. This is kind of a big deal. By allowing a Webpack 5 compilation issue to exist as a roadblock to new web-app projects it inhibits Stellar's actual growth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

6 participants