Can't "import" or "require" messenger with JS
See original GitHub issuePlease do what you must, so that I can do:
let Messenger = require('messenger');
or…
import Messenger from 'messenger';
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Unable to export/import a TypeScript class: "TypeError
It seems that the name of file with the class definition can not be "index.ts". After, changing it to some other name, I...
Read more >import without extension · Issue #30927 · nodejs/node - GitHub
Now we must do import resources from './resources/index.js , instead of the good old require('./resources') .
Read more >JavaScript Require vs. Import - Bits and Pieces
With modern web development, we use require or import to refer to JavaScript dependencies. And, sometimes, we use both in combination and use ......
Read more >Webhooks - Messenger Platform - Meta for Developers
The Webhooks for Messenger Platform shows you how to configure a Node.js server to receive webhooks notifications sent by Meta, subscribe to messaging...
Read more >Getting Started · React Native Paper
The plugin only works if you are importing the library using ES2015 import statements and not with require . Note: The above examples...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If the npm package.json included a main tag like this:
"main": "build/js/messenger.js",
then it would work better and it could be imported like this:
import ‘messenger-hubspot’;
(I am going off of the npm package called messenger-hubspot.
@akarelas You can import it because inside the lib we haven’t any export and the lib work with the global window object. You only can do like:
import 'messenger/build/js/messenger';