You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the SDK doesn't support named imports when running in a Node.js environment:
// Doesn't work!import{ShopperLogin}from"commerce-sdk-isomorphic";// Have to do this instead:importcapifrom"commerce-sdk-isomorphic";const{ ShopperLogin }=capi;
It would be nice if named imports worked 😁
Steps to reproduce:
mkdir test-commerce-isomorphic-sdk-named-imports
cd test-commerce-isomorphic-sdk-named-imports
npm init -y
npm i commerce-sdk-isomorphic
# Set `"type": "module"` in your `package.json`.echo'import { ShopperLogin } from "commerce-sdk-isomorphic";'> index.js
node index.js
Observe the following error:
import { ShopperLogin } from "commerce-sdk-isomorphic";
^^^^^^^^^^^^
SyntaxError: Named export 'ShopperLogin' not found. The requested module 'commerce-sdk-isomorphic' is a CommonJS module, which may not support all module.exports as named exports
The text was updated successfully, but these errors were encountered:
Currently, the SDK doesn't support named imports when running in a Node.js environment:
It would be nice if named imports worked 😁
Steps to reproduce:
Observe the following error:
import { ShopperLogin } from "commerce-sdk-isomorphic"; ^^^^^^^^^^^^ SyntaxError: Named export 'ShopperLogin' not found. The requested module 'commerce-sdk-isomorphic' is a CommonJS module, which may not support all module.exports as named exports
The text was updated successfully, but these errors were encountered: