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.

`require` resolves to wrong module

See original GitHub issue

🐛 bug report

When bundled with Parcel, a firebaseui require resolves to dialog-polyfill instead. This only happens with Parcel. I haven’t been able to repro with Webpack or plain Node.

I haven’t encountered this with any other modules yet and don’t know what’s special about those modules. I’ve filed an issue withfirebaseui here (https://github.com/firebase/firebaseui-web/issues/618), but since I can’t repro with Webpack, I suspect firebaseui exposes some edge case where Parcel is doing something it’s not supposed to do.

🎛 Configuration (.babelrc, package.json, cli command)

Just import firebase and firebaseui and require('firebaseui'). See minimal repro below.

🤔 Expected Behavior

require('firebaseui') should return an object with an auth property.

😯 Current Behavior

It returns an object that looks like the output of require('dialog-polyfill').

💻 Code Sample

Minimal repro here: https://github.com/fongandrew/parcel-firebaseui

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node 10.8.0
npm/Yarn 6.2.0
Operating System Windows 10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
LuudJanssencommented, Sep 25, 2019

FYI: My PR for FirebaseUI was just merged, so it should be fixed in the next release! This ticket can be closed!

0reactions
github-actions[bot]commented, Apr 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I resolve ESM / require error using TS 4.8?
I find the only solution - convert from commonjs - to ESM (change type: module , and add that to my package.json ),...
Read more >
Module Resolution - webpack
A resolver is a library which helps in locating a module by its absolute path. A module can be required as a dependency...
Read more >
Have a JavaScript Module Not Found Error ... - Airbrake Blog
If you're seeing a "module not found: error: can't resolve," in your Javascript code, here's an explanation as to why and how to...
Read more >
CommonJS modules | Node.js v19.3.0 Documentation
Modules are cached after the first time they are loaded. This means (among other things) that every call to require('foo') will get exactly...
Read more >
require.resolve "Error: Cannot find module" but ... - Reddit
this is all I'm trying to do require.resolve("stream-browserify") but I get a module not found error even though I can see it exists...
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