[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closure Compiler modules are wrongly being shaken off #372

Closed
Doehl opened this issue Dec 12, 2017 · 2 comments
Closed

Closure Compiler modules are wrongly being shaken off #372

Doehl opened this issue Dec 12, 2017 · 2 comments

Comments

@Doehl
Copy link
Contributor
Doehl commented Dec 12, 2017

[REQUIRED] Describe your environment

  • Operating System version: Windows 10
  • Firebase SDK version: 4.8.0
  • Firebase Product: util (auth, database, storage, etc)

[REQUIRED] Describe the problem

When building a project with Google Closure Compiler (Advarnced) that imports firebase, then some util modules are being shaken off. That should stay in the code.

For some reason functions like deepCopy, createSubscribe and more, are removed from the build but still referent to in util/dist/esm/index.js. This results in variables not defined.
Uncaught ReferenceError: module$node_modules$$firebase$util$dist$esm$src$deepCopy is not defined

From the exported file. (The variables that does not have a $ prefix, are modules that were shaken away)

var $module$node_modules$$firebase$util$dist$esm$index$deepCopy$$ = module$node_modules$$firebase$util$dist$esm$src$deepCopy.$deepCopy$, $module$node_modules$$firebase$util$dist$esm$index$deepExtend$$ = module$node_modules$$firebase$util$dist$esm$src$deepCopy.$deepExtend$, $module$node_modules$$firebase$util$dist$esm$index$patchProperty$$ = module$node_modules$$firebase$util$dist$esm$src$deepCopy.$patchProperty$, $module$node_modules$$firebase$util$dist$esm$index$ErrorFactory$$ = module$node_modules$$firebase$util$dist$esm$src$errors.$ErrorFactory$, 
$module$node_modules$$firebase$util$dist$esm$index$createSubscribe$$ = module$node_modules$$firebase$util$dist$esm$src$subscribe.$createSubscribe$;

Steps to reproduce:

Flag used to tree shake
--dependency_mode=STRICT

import { initializeApp } from 'firebase/app';
import 'firebase/messaging';

------------------------

    const app = initializeApp(
      {
        apiKey: /* apiKey */,
        authDomain: /* authDomain*/,
        databaseURL: /* databaseURL*/,
        projectId: /* projectId*/,
        storageBucket: /* storageBucket*/,
        messagingSenderId: /* messagingSenderId*/
      }
    );

NOTE: I have used the fix in #370 to build with Closure Compiler

Relevant Code:

@google-oss-bot
Copy link
Contributor

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

@jshcrowthe
Copy link
Contributor

Closing as a dupe of #369

@firebase firebase locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants