"Error Installing 'sfs2x-api' Library in ReactJS: Source Map Parsing Issue

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

Post Reply
ciaoamigos
Posts: 70
Joined: 05 Sep 2021, 16:57

"Error Installing 'sfs2x-api' Library in ReactJS: Source Map Parsing Issue

Post by ciaoamigos »

I'm installing the library "sfs2x-api" for my React project using the command "yarn add sfs2x-api".
However, I'm getting this error:
"WARNING in ./node_modules/sfs2x-api/sfs2x-api.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '....../webchat/node_modules/sfs2x-api/sfs2x-api-1.8.0.js.map' file: Error: ENOENT: no such file or directory, open '....../webchat/node_modules/sfs2x-api/sfs2x-api-1.8.0.js.map'".

How can I fix this?
Thank you.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: "Error Installing 'sfs2x-api' Library in ReactJS: Source Map Parsing Issue

Post by Bax »

We are not familiar with ReactJS, so we are not sure how to help.
The NPM package actually contains the map file, but the name is simply sfs2x-api.js.map, without the version number.
Paolo Bax
The SmartFoxServer Team
ciaoamigos
Posts: 70
Joined: 05 Sep 2021, 16:57

Re: "Error Installing 'sfs2x-api' Library in ReactJS: Source Map Parsing Issue

Post by ciaoamigos »

In the sfs2x-api.js, there is a line starting with //# sourceMappingURL=sfs2x-api-1.8.0.js.map, then the browser will search for the specified mapping file (sfs2x-api-1.8.0.js.map) in the specified path. Please correct and fix this.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: "Error Installing 'sfs2x-api' Library in ReactJS: Source Map Parsing Issue

Post by Bax »

As a temporary fix, we suggest to edit the file manually and check if the error goes away.
If yes, we will then update the NPM package.
Paolo Bax
The SmartFoxServer Team
Post Reply