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

Failed to compile #614

Open
henrylee2678 opened this issue Nov 8, 2023 · 8 comments
Open

Failed to compile #614

henrylee2678 opened this issue Nov 8, 2023 · 8 comments

Comments

@henrylee2678
Copy link

./node_modules/@stomp/stompjs/bundles/stomp.umd.js 501:24
Module parse failed: Unexpected token (501:24)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| };
| this.close();

        origOnClose?.call(webSocket, {

| code: 4001,
| reason: Quick discarding socket (#${id}) without waiting for the shutdown sequence.,

@nabaonan
Copy link

same problem!

@harryli8725
Copy link

harryli8725 commented Nov 28, 2023

try to add this configuration in your webpack.config file
configure: (webpackConfig, { env, paths }) => { webpackConfig.module.rules.push({ test: /node_modules\/@stomp\/stompjs\/.*\.js$/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'], plugins: ['@babel/plugin-proposal-optional-chaining'], }, }, }); return webpackConfig; },

@xyz-npc
Copy link

xyz-npc commented Mar 2, 2024

I encountered a similar issue recently. After investigating, I realized that it was related to the node version.
If you’re using Node.js 16 or below, consider switching to a lower version of the package. This may resolve the issue.

@narjess89
Copy link

How did you fix the issue please? The node version I am using is 14, but I got the error

@narjess89
Copy link

@kum-deepak , can you please help me to resolve the issue ? I Want to use @stomp/stomp.js 7.0.0 with angular 9 and node 14 ? I had the described error when compiling the project.
Thank you for help

@kum-deepak
Copy link
Member

@kum-deepak , can you please help me to resolve the issue ? I Want to use @stomp/stomp.js 7.0.0 with angular 9 and node 14 ? I had the described error when compiling the project. Thank you for help

Please follow the tutorial at https://stomp-js.github.io/guide/rx-stomp/rx-stomp-with-angular.html

Do not use the latest rx-stomp, instead use 1.2.0.

@narjess89
Copy link

Hello @kum-deepak ,
Tank you for your response, Actually I am using @stomp/stomp.js and not @rx-stomp, so what version you recommand me to use for stomp/stomp.js ?
Thank you

@xyz-npc
Copy link

xyz-npc commented Jun 19, 2024

6.1.2 would be fine @narjess89

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

No branches or pull requests

6 participants