Yuri-Lima / woocommerce-rest-api-ts-lib

This is some improvements for the oficial WooCommerce repo. https://github.com/woocommerce/woocommerce-rest-api-js-lib I hope they merge or accept it as new repo. soon. Please few free to contact me.
MIT License
28 stars 8 forks source link

ERROR in ./node_modules/woocommerce-rest-ts-api/dist/index.mjs 23:0-28 #16

Closed Prains closed 1 year ago

Prains commented 1 year ago

Trying to compile code with your plugin, webpack loads with a error saying following: Module not found: Error: Can't resolve 'crypto' in 'C:\Users\user\Desktop\calc\node_modules\woocommerce-rest-ts-api\dist'

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:

Yuri-Lima commented 1 year ago

@Prains what I did was add that peace of code into the tsconfig. Let's see if that would work fine.

"baseUrl": "./",

"paths": { "crypto": [ "node_modules/crypto-js" ] },

Yuri-Lima commented 1 year ago

As per this section has not been updated, it will be closed soon.