PokeAPI / pokeapi-js-wrapper

PokeAPI browser wrapper, fully async with built-in cache
Mozilla Public License 2.0
273 stars 43 forks source link

Bugfix/axios webpack require #61

Closed lbineau closed 6 days ago

lbineau commented 1 week ago

The previous PR https://github.com/PokeAPI/pokeapi-js-wrapper/pull/58 introduced issues with the built file. This PR aim to fix this issue by changing the webpack target from node to web which was wrongly configured and probably worked because of node polyfill included by default: https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-nodejs-polyfills-removed

I've npm run test and npm run build, and everything seems to work. Then I included the built file locally in an index.html file and no more error are shown.

Error target: 'node'

node target showing a console error: require is undefined

Success target: 'web'

web target showing a console.log success
Naramsim commented 1 week ago

Hi! Thanks for the pr! Would it be possible to use a beta tag for this release? If we have positive feedback we will promote the code to a normal release

lbineau commented 1 week ago

@Naramsim Sure, can you explain me how to do this?

Naramsim commented 6 days ago

I should be able to do it according to the docs: https://docs.npmjs.com/adding-dist-tags-to-packages

So no action on your side

Naramsim commented 6 days ago

ok, I think I published the pokeapi-js-wrapper@beta version.

https://www.npmjs.com/package/pokeapi-js-wrapper?activeTab=versions

@isackender , could you try and install that version?

climaxmba commented 6 days ago

ok, I think I published the pokeapi-js-wrapper@beta version.

https://www.npmjs.com/package/pokeapi-js-wrapper?activeTab=versions

@isackender , could you try and install that version?

@Naramsim, I just tried that and it works just fine. Here is a live demo: https://climaxmba.github.io/memory-card/. And the repo: https://github.com/climaxmba/memory-card

isackender commented 6 days ago

Thanks @lbineau @Naramsim @climaxmba Version 1.2.6 works perfectly now! :)