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.

enquire is undefined

See original GitHub issue

I’m having some trouble with this. I’ve included it using import via gulp / webpack. the enquire.js code gets included in my main.bundle.js file above the code that references it.

Then, when I try to use it, enquire.default.register("screen and (max-width:560px)", {

I get error

enquire is undefined

What have I done wrong?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
WickyNilliamscommented, Oct 8, 2019

Actually, I take that back, I can import enquire.js directly, as seen here: https://codesandbox.io/s/adoring-cloud-rfncs

import enquire from "enquire.js";
0reactions
WickyNilliamscommented, Oct 8, 2019

For reasons I can’t quite recall, the main field of package.json is set to ./src rather than the ./dist/enquire.js. So currently, you should be able to import enquire like this:

import enquire from "enquire.js/dist/enquire";

Here’s a working example: https://codesandbox.io/s/naughty-bash-9q0og. To test you’ll need to open this and resize your window: https://9q0og.csb.app/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting undefined function in my script? [closed]
I am having some trouble with a PHP contact form, when submitted this form returns only phone number: and also enquiry: undefined ....
Read more >
enquire in /catalog/controller/extension/module/featured.php ...
Add column in database. But I am getting Notice: Undefined index: enquire in /catalog/controller/extension/module/featured.php in line 71 error ...
Read more >
Cannot read property 'hasEnquire' of undefined - Drupal
When using a node template panel, after adding breakpoints, IPE no longer functions and I get the below JS error: Uncaught TypeError: Cannot ......
Read more >
Undefined Index Error - PHP - SitePoint Forums
Hi, I've got a contact form which keeps erroring on load up with 'undefined index' Any one shed some light on it? http://ralphcoleman.net/Contact/...
Read more >
Enquiry: Om undefined
Have a Question? C-1, Second Floor, Vaishali Nagar Shopping Complex, Near Bikaner Sweets, Ajmer - 305001. (Rajasthan.) India.
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