Vonage / vonage-node-sdk

Vonage API client for Node.js. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Apache License 2.0
375 stars 178 forks source link

Require broken with Vonage Server SDK 3.0.11 #774

Closed lawrenceong closed 1 year ago

lawrenceong commented 1 year ago

Requiring Vonage Server SDK is broken in 3.0.11

Expected Behavior

It should be possible to require the SDK. This was tested with 3.0.10.

node
Welcome to Node.js v16.18.1.
Type ".help" for more information.
> const { Vonage } = require('@vonage/server-sdk');
undefined

Current Behavior

It is producing an error with 3.0.11.

node
Welcome to Node.js v16.18.1.
Type ".help" for more information.
> const { Vonage } = require('@vonage/server-sdk');
.../node_modules/@vonage/server-sdk/dist/index.js:1
export { Vonage } from './vonage';
^^^^^^

Uncaught SyntaxError: Unexpected token 'export'

Steps to Reproduce (for bugs)

  1. Install version 3.0.11 of the server SDK: npm i @vonage/server-sdk@3.0.11
  2. See above on how to reproduce the issue

Context

Issue does not affect us at the moment. We just revert to 3.0.10.

Your Environment

naytun commented 1 year ago

I have the same issue!!

manchuck commented 1 year ago

For sanity, if you add --experimental-vm-modules to the node executable, does the error disappear?

lawrenceong commented 1 year ago

For sanity, if you add --experimental-vm-modules to the node executable, does the error disappear?

Same issue

❯ node --experimental-vm-modules
Welcome to Node.js v16.18.1.
Type ".help" for more information.
> const { Vonage } = require('@vonage/server-sdk');
.../node_modules/@vonage/server-sdk/dist/index.js:1
export { Vonage } from './vonage';
^^^^^^

Uncaught SyntaxError: Unexpected token 'export'
lawrenceong commented 1 year ago

@manchuck I recommended pulling the 3.0.11 release as it does not currently work for us: https://docs.npmjs.com/unpublishing-packages-from-the-registry

byungjuJin commented 1 year ago

I also got same isssue!

manchuck commented 1 year ago

@lawrenceong @byungjuJin This issue has been fixed with 3.0.12. I made the mistake of marking the server-client package as a module which caused all the headaches. Please LMK if you are still having an issue