xDimGG / node-steamapi

An object-oriented Steam API wrapper for Node.js developers.
https://www.npmjs.com/package/steamapi
177 stars 43 forks source link

lack of es5 build in npm package breaks out-of-the-box build from create-react-app #9

Closed bdefore closed 4 years ago

bdefore commented 5 years ago
→ npm run build

> react-scripts build

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file: 

        ./node_modules/steamapi/src/structures/Player.js:1 

Read more here: http://bit.ly/2tRViJ9

The link there explains what needs to be done in order to be compatible: http://bit.ly/2tRViJ9

bdefore commented 5 years ago

i can confirm that the workaround mentioned in the article does work:

copy node_modules/steamapi to your src directory and then import that via relative path i.e.: const SteamAPI = require('./vendor/steamapi/src/SteamAPI')

still would be nice to have an es5 build in the package

ShayBox commented 5 years ago

es5 is old, stop using it 💢

ghost commented 5 years ago

@ShayBox CRA targets es5 (ie9+). it's not an unreasonable request since it would allow them to avoid ejecting

ShayBox commented 5 years ago

Good meme

ghost commented 5 years ago

thanks

bdefore commented 5 years ago

the workaround no longer works with a project upgraded to newly released CRA2, which seems to not like module exports. specifically requiring a vendor directory of node-steamapi fails on: TypeError: Cannot assign to read only property 'exports' of object '#<Object>' from Achivement.js

xDimGG commented 4 years ago

Not really familiar with this myself. I'll leave it up to someone else to support this if they choose.