-
Notifications
You must be signed in to change notification settings - Fork 79
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
React application based on create-react-app
cannot include rhea
#379
Comments
There is an equivalent file for rhea, also under dist. Can you try adding a similar section to package.json and see if that resolves it for you? |
The last time I looked, |
…lement, never rendered directly. Please wrap your <Route> in a <Routes>. * Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app. See https://reactrouter.com/docs/en/v6/upgrading/v5, and therein linked https://gist.github.com/mjackson/d54b40a094277b7afdd6b81f51a0393f * BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. * Module not found: Error: Can't resolve 'os' in '/home/jdanek/repos/qpid/qpid-dispatch/console/react/node_modules/rhea/lib' * facebook/create-react-app#11756 * downgraded and filled amqp/rhea#379
Replacing
with
silenced the webpack error. So, I don't know why edit: sorry, I started celebrating before I tried to actually run the console: ```this.rhea.websocket_connect is not a function```` I'll investigate more. |
…lement, never rendered directly. Please wrap your <Route> in a <Routes>. * Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app. See https://reactrouter.com/docs/en/v6/upgrading/v5, and therein linked https://gist.github.com/mjackson/d54b40a094277b7afdd6b81f51a0393f * BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. * Module not found: Error: Can't resolve 'os' in '/home/jdanek/repos/qpid/qpid-dispatch/console/react/node_modules/rhea/lib' * facebook/create-react-app#11756 * downgraded and filled amqp/rhea#379
…ase (#1517) * Error: A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>. * Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app. See https://reactrouter.com/docs/en/v6/upgrading/v5, and therein linked https://gist.github.com/mjackson/d54b40a094277b7afdd6b81f51a0393f * BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. * Module not found: Error: Can't resolve 'os' in '/home/jdanek/repos/qpid/qpid-dispatch/console/react/node_modules/rhea/lib' * facebook/create-react-app#11756 * downgraded and filled amqp/rhea#379
I'm still confused about the js modules, to tell the truth. As far as I can figure, what rhea needs to provide is an ESM package (as in https://github.com/eslint/rfcs/pull/72/files). In any case, I haven't figured a way how to |
I got feedback from @bartoval that the The entire issue probably stems from the fact that rhea is a nodejs library and using it in browser requires some steps (which the new react-scripts` for some reason refuse to perform automatically). |
I think it will be nice providing a further bundle compatible with modules. The current dist/rhea.js or (dist/rhea.min.js) works only using a script tag. We can create a bundle compatible with UMD using the option --standalone. doc We just need to modify the command in the package.json and generate both rhea.js and rhea-module.js
then @jiridanek you can call
I can create the PR. What you do think @grs ? |
This is because react-script 5 uses Webpack 5 that removed the node.js polyfill |
@bartoval, sounds good to me |
When I upgrade from react-scripts=4.0.3 to react-scripts=5.0.0, I get the following failure from (new version of) webpack:
This is a known problem for create-react-app users, facebook/create-react-app#11756
If I am reading the comments correctly, there is an expectation for packages to themselves provide a 'browserified' version of their library. See this commit for handlebars, linked from the create-react-app issue https://github.com/handlebars-lang/handlebars.js/pull/1540/files.
Therefore, I'd like to request a feature in rhea that would just make things work for me again, whatever shape or form such feature needs to take.
The text was updated successfully, but these errors were encountered: