question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't "import" or "require" messenger with JS

See original GitHub issue

Please do what you must, so that I can do:

let Messenger = require('messenger');

or…

import Messenger from 'messenger';

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
gregverescommented, Dec 6, 2017

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.

1reaction
draggcommented, Mar 29, 2017

@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';

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found