SnaBe / node-steam-market-fetcher

A Node.js wrapper for the Steam Community Market API.
https://www.npmjs.com/package/steam-market-fetcher
MIT License
26 stars 3 forks source link

BREAKING CHANGE error #14

Closed isaiahwiesner closed 1 year ago

isaiahwiesner commented 1 year ago

Hi there, I recently installed this package and I am encountering the folloring error:

Module not found: Error: Can't resolve 'os' in 'C:\Users\User\Desktop\Websites\csskintrack\node_modules\@colors\colors\lib\system'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
    - install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
    resolve.fallback: { "os": false }

All I have done is initialized a new instance of the class like so:

import SteamMarketFetcher from 'steam-market-fetcher'
const Fetcher = new SteamMarketFetcher({
  currency: 'CAD',
  format: 'json'
})

I know the Readme mentions the documentation on the wiki of this repo should help when you encounter this, but I'm not sure what the solution is. Thank you in advance for any help!

SnaBe commented 1 year ago

Hi, thanks for reporting the issue!

Can you tell me more about your dev environment? Like what framework you're using? TypeScript project or a similar Node.js configuration?

As the error mentions Webpack, I'm unsure of your intention or goal with the module. As a side note, the module was not developed with browser or frontend framework support in mind.

I also assume you running the latest version 1.8.0

I'll look into it asap, but I'll need a little more info, as NPM's RunKit shows no errors after instantiation. I've provided you an example here.

Best regards, SnaBe

isaiahwiesner commented 1 year ago

I'm using React and JavaScript and I'm just trying to fetch from the API and display data.

SnaBe commented 1 year ago

Alright, I would refer you to this previous issue #6 that also discusses the use of the module with React. The error is different but my conclusion is the same, however, feel free to create a feature request for browser support.