expo-server-sdk-node
(Write your steps here:)
const Expo = require('expo-server-sdk')let expo = new Expo();It should create a new instance of Expo
(Write what you thought would happen.)
When I use version ^2.3, it works like a charm. However, when I upgraded to version 3, it stopped working.
It throws an error: TypeError: Expo is not a constructor.
My guess is you guys changed some methods but the documentation doesn't anything on what has to be done to upgrade.
The release notes explain this explicitly in the Breaking Changes section: https://github.com/expo/expo-server-sdk-node/releases/tag/v3.0.0
JavaScript Modules: CommonJS-style require() calls, as opposed to JavaScript import statements, must now explicitly import either the default export or the named Expo export. Any of these work:
const { Expo } = require('expo-server-sdk');
const { default: Expo } = require('expo-server-sdk');
import Expo from 'expo-server-sdk';
import { Expo } from 'expo-server-sdk';
Does not work: const Expo = require('expo-server-sdk');
Most helpful comment
The release notes explain this explicitly in the Breaking Changes section: https://github.com/expo/expo-server-sdk-node/releases/tag/v3.0.0