-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Description
When using package in an ES module, I get the following error:
TypeError: FacebookConversionAPI is not a constructor
When not using in an module, wit.h const instead of import, then the code works as expected.
Expected
No error when using ES import syntax 😄
Code
import http from 'http';
import FacebookConversionAPI from '@rivercode/facebook-conversion-api';
const FBConversionAPI = new FacebookConversionAPI(xxxxx);
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Versions
Node.js v17.8.0
FacebookConversionAPI v1.1.8
Metadata
Metadata
Assignees
Labels
No labels